MULTIMEDIA COMMUNICATIONS NETWORK

Abstract: A circuit configuration in a multimedia network (10) simulates an actual meeting room where the conferences between two or more people may be held. This facilitates the creation in the network (10) of flexible, long-term multimedia conferences between conferees who are separated from one another. Any number of conferees may communicate with one another via one or more of audio, video, and data. Virtual meeting rooms may persist in the network (10) for predetermined periods of time controlled by the users of the meeting room. The room may remain in the network (10) independent of whether or not a user is connected to the room. The meeting room is a vehicle whereby the activity of various media servers (50, 54, 58) coordinated to effectuate conferences between multiple participants in more than one medium. The servers are associated with storage devices (164) which may record or store certain aspects of multimedia conferences using the virtual meeting room.

Description: MULTIMEDIA COMMUNICATIONS NETWORK CROSS-REFERENCE TO RELATED APPLICATION This application is related to Application Serial No. [Kuthyar 1-1-1-7] of Ahuja, Arava udan, Ensor, Kuthyar, Ramamurthy, Stuntebeck, and Weber filed in the Patent and Trademark Office on the same day this application is being filed. TECHNICAL FIELD This invention relates to communications networks. More particularly, this invention relates to multimedia communications networks able to effectuate conferences between two or more parties in multiple media, such as voice, video, and data. BACKGROUND The essential characteristics of face-to-face meetings can be simulated by multimedia conferencing systems. Such conferencing systems permit separated conference participants to communicate with one another in multiple media such as voice, video, and data from their own work places without requiring that they actually convene in the same place. In one prior approach, these conferencing systems involve a plurality of complicated and expensive computer workstations connected together by transmission facilities which act merely as a transport mechanism for whatever is to be communicated between the workstations. There are significant problems with such a distributed architecture which are preventing this approach from becoming a widespread commercially viable reality. Each of the workstations in these prior distributed environments contains a large amount of the multimedia data processing capabilities, including the necessary bridging and synchronization circuits, used to effectuate a conference between meeting participants. This increases the cost to each potential multimedia user which usually places multimedia communications beyond that user's interest or financial means. In addition, prior localized desktop applications make it difficult to achieve long-term flexible multimedia conferencing environments conveniently because at least one of the workstations must stay up at all times during the required life of the conference environment. There is no way convenient for all the conferees to leave the conference and then easily return and pick up the conference where it left off. It also is difficult to synchronize the various parts of a multimedia conference for proper presentation to the meeting participants in a distributed environment. In this situation, it is difficult to create multimedia connections between disparate communications equipment, for example, two computers running different operating systems. In addition to the distributed architectures described above, there are some centralized architectures involving media bridges located in the network rather than in local workstations. For example, the AT&T long distance network contains some audio and video bridging capability such as the bridging involved in the AT&T Alliance teleconferencing service and the AT&T Global Business Video Conferencing Services. Although these services are useful telecommunication services, Applicants have identified significant areas which might be improved. Applicants have appreciated that it is difficult to achieve flexible, long term multimedia conferences between a variable number of users having different media capabilities. Synchronous modes of communications, such as telephone calls, and asynchronous modes of communications, such as electronic mail, are not easily merged in the prior multimedia communications systems. The prior multimedia communications systems also make it difficult to integrate disparate communications equipment possessed by various conferees into an effective multimedia conference. It is difficult for conferees having different levels of multimedia communications capabilities to enter and leave a given multimedia conference freely. There is no convenient way to effectuate multimedia communications between many potential users such as those who might be connected together by way of a complicated network, such as an extensive local area network or a wide area network such as a public telephone network. For example, there is no way for a telecommunications carrier to provide a multimedia communications service to a wide range of its telephone customers using the present multimedia conferencing systems. SUMMARY The problems mentioned above are solved by a multimedia communications network which provides a shared multimedia work environment accessible from one or more multimedia ports. In specific terms, the multimedia communications network comprises at least one meeting room server located in the network and connected to a plurality of ports which provide users with access to the network. The meeting room server creates a special electronic circuit configuration in the network in response to a command from a user terminal connected to one of the multimedia ports. The electronic circuit configuration has predetermined characteristics created by the users of the network and has a preselected lifetime in the network in accordance with the desires of those who use the electronic circuit configuration to effectuate electronic multimedia conferences. The electronic circuit configuration may be a data structure which represents a controllably persistent virtual meeting room in the network. Conferences may be held using this meeting room involving any number of participants. Those conference participants may be able to communicate with the others in a variety of media. They need not each have the same ability to communicate in all media. The participants may come and go with respect to conferences held in the virtual meeting room. Even when all participants leave a conference, the virtual meeting room will persist in the network and may be used at a later time to resume or continue the conference by the same participants or others. The virtual meeting room may be used to initiate or continue other conferences by the same participants or others. The virtual meeting room is thus an electronic analog of a physical meeting place where conferences are held. BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is an illustrative multimedia network constructed in accordance with the principles of this invention. FIG. 2 is an illustrative connection topology involving two multimedia workstations connected through pertinent portions of the multimedia network of FIG. 1. FIGs. 3a-3d are representations of an illustrative virtual meeting room created in the meeting room server of FIG. 2. FIG. 4 is a state diagram representing the operation of one of the meeting room servers in FIG. 1 with respect to one virtual meeting room created in the network. FIG. 5 is a state diagram representing the operation of one of the conversation managers in FIG. 2 with respect to one virtual meeting room created in the network. FIG. 6 is a block diagram of a generalized media server associated with storage devices which assist in effectuating a persistent characteristic of a virtual meeting room in accordance with this invention. DETAILED DESCRIPTION FIG. 1 shows a multimedia network 10 which can selectively connect together one or more of a number of devices so that information may be transported from one device to another. The devices may include one or more multimedia workstations, such as a pair multimedia workstations 12 and 14 shown in FIG. 1. The multimedia workstations are connected to respective multimedia ports of the network 10 and are capable of communicating with one another and with other devices connected to the network 10 in a plurality of media such as audio, video, and data. Other devices which can be interconnected by the network 10 in FIG. 1 include a camera 16, a video cassette recorder 18, a facsimile device 20, a telephone 22, and a television 24. The telephone 22 may be simple POTS telephone, an ISDN telephone, a cellular or other wireless telephone, or any other voice band telecommunications device such as a personal communicator. Each of the devices shown in FIG. 1 is connected to the network 10 by means of suitable connections to appropriate ports of the network 10. The network 10 contains a number of servers used to effectuate connections in predetermined media between selected ones of the devices shown in FIG. 1. The network 10 contains one or more meeting room servers 1, 2, ..., i each of which is a repository of information relating to virtual meeting rooms created in the network 10. The characteristics of illustrative virtual meeting rooms are described in more detail below. The meeting room servers also coordinate and control access to media servers in the network 10. Those media servers include one or more data servers 1, 2, ..., j, one or more video servers 1, 2, ..., k, and one or more audio servers 1, 2, ..., 1. The data servers selectively connect the data portions of the inputs and outputs of the devices shown in FIG. 1 with selected data inputs and outputs of others of the devices shown in FIG. 1. Similarly, the video servers selectively connect the video inputs and outputs of the devices shown in FIG. 1 and the audio servers selectively connect the audio inputs and outputs of those devices. The network 10 also contains one or more name servers 1, 2, ..., each of which may store addresses of the devices connected to the network 10 and addresses of network resources used by the media servers and the meeting room servers. The meeting room servers are responsive to information handled by the name servers to create associations between selected users and selected virtual meeting rooms. In one example of the invention, the servers shown in FIG. 1 may be implemented as software entities on one or more UNIX ® based workstations such as those made by Sun Microsystems. As described in more detail below, controllably persistent virtual meeting rooms can be created in the multimedia network 10 shown in FIG. 1 which can be used to effectuate flexibly configured multimedia conferences of any required direction between two or more users of the network 10. FIG. 2 shows an illustrative multimedia connection between the workstations 12 and 14 in FIG. 1 through the network 10. Workstation 12 contains a user interface 26 which may include a visual interface on a computer. -The interface may also include data entry devices such as a keyboard, a mouse, pen based entry devices, or speech activated input devices. The user interface 26 is connected to a conversation manager 28. The conversation manager 28 coordinates the activity of a group of media managers located in the workstation 12. The conversation manager 28 is also a signaling agent in the workstation 12 which signals the network 10 to create or destroy one or more virtual meeting rooms used by the operator of the workstation 12. The conversation manager 28 also is used to signal the network 10 to create various meeting configurations in each of the virtual meeting rooms accessible by the operator of the workstation 12. The workstation 12 also contains a group of media managers which are associated with respective hardware devices and software entities which produce outputs in respective media and receive inputs in those respective media from other participants in the conference. The workstation 12 contains a data manager 30 which receives data produced by one or more application programs running in the workstation 12, such as spreadsheet programs, word processing programs, graphics programs, and the like. The data manager 30 directs this data to other meeting participants through the network 10, specifically, in this example of the invention, to other similar data managers in multimedia workstations participating in the conference. The workstation 12 also contains a video manager 32 which receives video signals from one or more video devices associated with the workstation 12 such as video cameras, vcr's, scan converters, and the like. The video manager 32 directs video signals to other meeting participants through the network 10, for example, to other video managers in similar multimedia workstations. Finally, the workstation 12 contains an audio manager 34 which is associated with one or more audio devices, such as telephones, microphones, and the like. In addition to sending signals from the workstation 12 to other meeting participants through the network 10, the media managers 30, 32, and 34 also receive respective signals from other meeting participants and appropriately communicate those signals to the user of the workstation 12 in an appropriate manner. For example, the managers 30, 32, and 34 may cause data and video to be displayed on a television or video monitor and audio to be played through a speaker. There may be other media managers in the workstation 12 in other examples of the invention, for example, a manager to handle facsimile signals produced by the workstation 12 or received by the workstation 12. Signalling messages are directed between the conversation manager 28 and the data manager 30 on line 29; signalling messages are directed between the conversation manager 28 and the video manager 32 on line 31; and signalling messages are directed between the conversation manager 28 and the audio manager 34 on line 33. Similarly, workstation 14 contains a user interface 36 connected to a conversation manager 38. The workstation 14 also contains a data manager 40, a video manager 42, and an audio manager 44 connected to the conversation manager 38 by way of signalling lines 39, 41, and 43, respectively. The workstations 12 and 14 may be UNIX® based computers or workstations such as those made by Sun Microsystems and the like. The manager and user interfaces may be software entities on those computers. User terminals, such as workstations 12 and 14 in FIG. 2, are connected to multimedia ports of the network 10. Signalling and communications traffic in multiple media are received in the multimedia ports from respective user terminals connected to the multimedia ports. An example of the multimedia ports also direct signalling and communications traffic in multiple media to respective user terminals connected to the multimedia ports. The details of how signalling and multimedia communications traffic of workstations 12 and 14 are connected to multimedia ports of the network 10 are shown in FIG. 2 and described below. In a multimedia connection between the workstations 12 and 14, the conversation manager 28 in the workstation 12 is connected to the conversation manager 38 in the workstation 14 by means of a suitable connection 46 through the network 10. Each of the multimedia workstations is associated with a particular one of the meeting room servers shown in FIG. 1. In the example shown in FIG. 2, the workstations 12 and 14 each are associated with the same meeting room server 48, which may, for example, be meeting room server 1 shown in FIG. 1. A connection between the workstations 12 and 14 is initiated by a workstation user first creating a persistent virtual meeting room in the meeting room server 48 by way of commands from one of the conversation managers 28 or 38 to the server 48 on one of lines 45 or 46. The virtual meeting room comprises a data structure in the meeting room server 48 representing certain computer resources allocated to the connections and signalling between the workstations 12 and 14. For example, those resources may involve part or all of a memory, a computer file, a database table, or other memory or storage facility associated with the meeting room server 48. More than one meeting room may be created in each meeting room server in the network 10. Each virtual meeting room is given a unique identification by which it can be accessed by potential users of the meeting room. The virtual meeting room may contain the identities of the servers which will be used to effectuate connections in various media between the workstations 12 and 14. In addition, the virtual meeting room will contain the identities of the participants involved in meetings held in the virtual meeting room. There may be one or more meetings held in the virtual meeting room, each of which is also given a unique identification stored in the virtual meeting room. The virtual meeting room may also contain information about certain access rights of potential conference participants who may be permitted to use the room. In certain situations it may be advantageous for the virtual meeting room to contain information about the length of time it has existed in the network. For example, in a situation where the network 10 is a telephone network, it would be advantageous for the virtual meeting room to contain information about the time at which it was originally created and the amount of time it was used to actually hold conferences. This information may be used for purposes of billing telephone customers for using a virtual meeting room to hold conferences and store information in the network about those conferences. FIGs. 3a-3d are illustrations of a representative virtual meeting room 47 which may be created by the meeting room server 48 in FIG. 2. In the example of FIG. 3a, the meeting room comprises a designated region in the memory of the server 48 set aside for this particular virtual meeting room. A unique virtual meeting room identification is stored in location 49. Access rights to the virtual meeting room are stored in location 51. These access rights signify who may use this virtual meeting room. Reservation attributes are stored in location 53. Reservation attributes may include information about the persons who have reserved the virtual meeting room, the time period during which the room has been reserved, and the identity of the media servers which will be used. Any other users, not identified in the reservation attributes, will be denied the use of the room during a reserved period. Reservation conflicts may be resolved by using some sort of a priority scheme. There can be multiple reservations of a virtual meeting room at nonconflicting times. Descriptions identifying the characteristics of m media servers which have been associated with the virtual meeting room 47 are stored in locations 55. As shown in FIG. 3b, each server description may comprise a designation 59 uniquely identifying each server. Those server descriptions may also contain connection information 61, for example, the network address of the respective server. The server descriptions may also contain information 63 about who has the right to access the particular server, billing information 65 relating to the usage level of each billable user of the server, reservation information 67 reflective of the reservation attributes described above relating to this server, and a service description 69, which may define the particular kind of audio, video, or data services handled by this server, for example, voice messaging, audio information services, NTSC video (compressed and uncompressed) , bulletin board services, games, weather, news, and the like. The room 47 may also contain a representation relating to a meeting between a group of meeting participants. Descriptions identifying n such meetings which have been or will be held using the virtual meeting room are stored in locations 57. As shown in FIG. 3c, each meeting description contains a unique meeting identifier stored in location 71, access rights 73, billing information 75, and one or more participant descriptions 77. As shown in FIG. 3d, each participant description shown in FIG. 3c may contain a unique identifier 79, state information 81 relating to whether or not the participant is using the meeting room, a static media description 83 indicating the media in which this participant is capable of communicating, a dynamic media description 85 indicating the media in which this participant is currently communicating, and a profile 87 containing information about the participant which might be useful to the network such as the length of time the participant was a part of the meeting, what resources he used during the course of the meeting, and whether and how this participant to be billed. The server 48 may contain any number of meeting rooms. Each meeting room may contain any number of servers, any number of meetings and any number of participants in each meeting. Each participant may communicate in any one or more of a plurality of communications media, such as audio, video, and data. The virtual meeting room created in the meeting room server 48 has a characteristic of persistence, which means that the data structure defined by the virtual meeting room may remain in the network for a predetermined period of time controllable by users of the network. The virtual meeting room may even remain in the network though there are no users connected to the meeting room or to the network. Moreover, the length of time a virtual meeting room is to persist in the network is controllable by one or more of the users of the virtual meeting room. Such a persistent meeting room is also a mechanism by which certain preselected events occurring during the course of a multimedia or other conference may be recorded as they occur during the conference. These events may later be stored in the network for a predetermined time set by one or more of the conference participants independent of whether or not any conference participants are actually connected to the network or are using the virtual meeting room. For example, in a situation where the multimedia network 10 is a telephone network, all conferees may go on hook and information about their conference selected by the conferees will be stored in the network for any of them to retrieve in the future. This storage capability also permits conferences to be suspended and later resumed at a point where it was suspended. New conferees may join an existing conference and be brought up to speed on what happened earlier in the conference. Some or all of the information in a virtual meeting room may be deleted by selected ones or all of the users of that virtual meeting room. In a multimedia conference between workstations 12 and 14, the meeting room server 48 is connected to one of the data servers 50 in the network 10 by means of a two- way connection 52. The meeting room server 48 is connected to one of the video servers 54 in the network 10 by means of a two-way connection 56. Similarly, the meeting room server 48 is connected to one of the audio servers 58 in the network 10 by means of a two-way connection 60. One of the name servers 62 in the network 10 is connected to the meeting room server 48 by means of a two-way connection 64. The data server 50 receives data output and data signalling produced by the data managers 30 and 40 in the workstations 12 and 14 on two-way connections 66 and 68, respectively. The data outputs and signalling from each of the workstations 12 and 14 are directed by the data server 50 to the other of the workstations so that the data produced by each workstation can be shared between the users of the two workstations 12 and 14. This is accomplished by the data server 50 receiving the data output and signalling of the data manager 30 of the workstation 12 on line 66 and directing it to the data manager 40 in the workstation 14 on line 68. The data server 50 also receives the data output and signalling from the data manager 40 in the workstation 14 on line 68 and directs that data output and signalling to the input of the data manager 30 in the workstation 12 on line 66. The video server 54 receives video output and video signalling of the workstation 12 from the video manager 32 on a two-way connection 70 and video output and video signalling of the workstation 14 from the video manager 42 on a two-way connection 72. The video server 54 directs the video and signalling received from the workstation 12 on the connection 70 to the workstation 14 by way of the connection 72. The video server 54 also directs the video and signalling received from the workstation 14 on connection 72 to the workstation 12 by way of the two-way connection 70. The audio server 58 receives workstation 12's audio output and audio signalling from the audio manager 34 on a two-way connection 74 and directs that audio output and signalling to the audio manager 44 in the workstation 14 by way of a two-way connection 76. The audio server 58 also receives workstation 14's audio output and audio signalling from the audio manager 44 on connection 76 and directs that audio output and signalling to the audio manager 34 by way of the connection 74. Although the example of the invention shown in FIG. 2 only deals with a connection between two multimedia workstations, the invention is equally applicable to any number of conference participants who may be involved in a single conference. The data server 50, video server 54, and the audio server 58 essentially act as bridging circuits for combining the respective media outputs of the conference participants and directing selected ones of those outputs to the participants on appropriate communications paths. The assembly and coordination of the servers to effectuate a multimedia conference between plural participants is handled by the multimedia server 48 using the information stored in a virtual meeting room created for handling a conference between the participants. A meeting room interface 78 is connected to the meeting room server 48 so that the server 48 may be provisioned with certain information generated by network administrators and the like. Information about the meeting rooms in the network 10 may be obtained through the interface 78. The meeting room server is connected to other meeting room servers in the network 10 by means of a connection 80 attached to an input/output port of the server 48 which is needed in situations where the conference participants are assigned to use different meeting room servers located in the network. FIG. 4 is a state diagram illustrating in detail the nature of the operation of the meeting room server 48 in FIG. 1 with respect to a single virtual meeting room. Similar state diagrams are applicable for each virtual meeting room handled by the server 48. In FIG. 4, each state in which the server 48 may reside relative to a given virtual meeting room is represented in schematic form by an oval shaped structure. Transitions between states are represented by arrows labeled with numbers preceded by a capital "E" . Self-loops are identified by numbers preceding by "SL". Table I is a listing of all the state transitions shown in FIG. 4. Table I is a complete listing of the allowed transitions, referred to as "edges", including an identification of that which triggers a transition between states along with the action which takes place as a result of the trigger. Prior to the creation of a virtual meeting room in the server 48, the server 48 is in a ground state 82. The server 48 receives a command from a conversation manager in a workstation associated with the server 48 to create an empty virtual meeting room which may be an allocation of memory space or other computer resources to specific conferences which will be entered into by a user who creates the virtual meeting room and others. The meeting room server 48 leaves the ground state 82 and enters an empty room state 84. Appropriate servers may be associated with the empty room to effectuate conferences in predetermined media. These servers may be selected from the collection of servers in the network, such as those illustrated in FIG. 1. When a server is to be associated with a virtual meeting room, the meeting room server 48 leaves the empty room state 84 and enters a wait state 86 as a result of a command, for example, from the conversation manager in the workstation which created the virtual meeting room. Once a requested server has been actually assigned to the virtual meeting room, for example, when an acknowledgement is generated by a server requested to be associated with the virtual meeting room, the meeting room server 48 then enters a state 88 signifying that there is a virtual meeting room with at lease one associated server. When the server 48 is in the state 88, additional servers may be added to the virtual meeting room upon appropriate command from a conversation manager, as signified by the second wait state 90 shown in FIG. 4. In addition to creating an empty virtual meeting room and associating predetermined network resources to that virtual meeting room, actual meetings may be held in the virtual meeting room whereby conference participants may be connected to one another in selected media. Two or more participants may share one or more of audio, such as the usual voice conversations, data such as certain computer programs, and video such as that produced by cameras situated in the locations of the conference participants. In this regard, the conversation manager signals the meeting room server 48 to create a uniquely identified meeting in the virtual meeting room. The server 48 leaves the state 88 and enters a state 90 in which the virtual meeting room contains servers and in which a meeting is being conducted. In state 90, additional servers may be added, as signified by the wait state 92 in FIG. 4. While the server 48 is in state 90, any number of conference participants may be added to or dropped from the meeting as signified by the self-loop SL2 shown in FIG. 4. A meeting may be suspended in which all of the conference participants either go on hold or actually entirely disconnect from the network 10, as signified by a transition from state 90 to state 94 in FIG. 4. Since the virtual meeting room has a persistent characteristic, the meeting room and information about the meeting may continue to be stored in the network 10 in accordance with the desires of the meeting room users. The meeting may be resumed by one or more users at a place where the meeting was suspended as represented by a transition from state 94 to state 90. In addition to the states and transitions described above, the meeting room server 48 may also enter into a state 96 from the empty room state 84 involving a situation where there is a virtual meeting room in the server 48 having a meeting but no servers as yet. Servers may be added as represented by the wait state 98 from which the state 90 may be entered involving a virtual meeting room associated with servers and conference participants. A terminate state 100 in which the virtual meeting room and its contents are completely erased from storage in the network 10 may be entered into by the meeting room server 48 from any of the other states shown in FIG. 4 in response to a command from a preselected conversation manager. FIG. 5 is a state diagram representing the operation of a conversation manager in a multimedia workstation with respect to a single virtual meeting room. Additional state diagrams like the one in FIG. 5 may represent the operation of that conversation manager with respect to other virtual meeting rooms with which that manager is associated. As in the case of FIG. 4, the state diagram of FIG. 5 is composed of representations of the states in which the conversation manager may reside along with the allowed transitions between those states. Table II is a complete listing of the allowed transitions, referred to as "edges", including an identification of that which triggers a transition between states along with the action which takes place as a result of the trigger. For purposes of this description, it is assumed that a user of workstation 12 desires to call a user of workstation 14. The operation of a conversation manager begins in a ground state 102 prior to a command from a user of the workstation to create a virtual meeting room in the network 10. When a user of the workstation 12 desires to communicate with someone else, for example, a user of workstation 14, he or she enters a request into the user interface of the workstation 12. This can be same as or analogous to a calling party dialing the telephone number of a called party to initiate a telephone call between the parties. The user desiring to be connected with another workstation user may manually select which media will be used to effectuate a conference. Alternatively, information about which media are to be used may be stored somewhere between the two workstation users for use in automatically configuring an appropriate connection between the users. Once the initiating user of workstation 12 has indicated a desire to set up a connection to another user, the conversation manager 28 enters a waiting state 104 during which the conversation manager 28 waits for the meeting room server 48 to create an appropriate virtual meeting room in the network 10. When the conversation manager 28 is notified that the virtual meeting room has been established, the conversation manager 28 then enters a wait state 106 during which the conversation manager awaits an indication that the meeting room server 48 has associated appropriate media servers with the virtual meeting room it has just created. Whenever servers are added to a virtual meeting room, the conversation manager 28 also organizes local resources in the workstation 12 to interface appropriately with each of the media servers associated with the virtual meeting room created by the meeting room server 48. When all of the appropriate media servers have been associated with the virtual meeting room, the conversation manager 28 enters a state 108 designated room with servers. While the conversation manager 28 is in state 108, additional servers may be added to the meeting room by making a transition from state 108 to state 112 and back. Also, servers may be dropped from the meeting room while in state 108 by making a transition from state 108 to state 110 and back. Whenever servers are dropped from a meeting room, the conversation manager 28 also deallocates corresponding local resources from the conference. When the conversation manager 28 is in state 108, a meeting may be created in the virtual meeting room. The conversation manager 28 makes a transition from state 108 to state 114 during which the conversation manager waits for a meeting to be created. Alternatively, the conversation manager 28 may reach state 114 via a state 150 which does not involve the association of a meeting room with servers. Servers also may be added to the virtual meeting room created along the path through state 150 when the conversation manager reaches a meeting-in-progress state 122 to be described below. This state is similar to the state 104 described above. Creation of a meeting in the virtual meeting room may be the creation of some identification for the meeting in the meeting room. When the meeting has been created in the virtual meeting room, the conversation manager 28 then makes a transition from state 114 to a state 116 during which the conversation manager 28 requests the meeting room server 48 to give it information about the person the user of the workstation is trying to contact, for example, the location of the user. When this information has been obtained, the conversation manager 28 makes a transition from state 116 to state 118 during which it waits for a message to be sent to the person to be contacted and a return message from that person that he or she wishes to meet with the user of the workstation 12. When the return message is received that the called party wishes to meet with the calling party, the conversation manager 28 sends a message to the meeting room server 48 to add the called party identification to the virtual meeting room. The conversation manager 28 awaits confirmation of this in state 120. When such confirmation is received, the conversation manger 28 makes a transition from state 120 to a meeting-in-progress state 122 during which the two workstation users are connected together and may communicate with one another in the selected media. What has been described above is a situation where the user of workstation 12 has initiated a connection with the user of workstation 14. In an alternative situation, where the user of workstation 14 has initiated a connection with the user of workstation 12, the conversation manager 28 makes a transition from the ground state 102 to a state 124 in which the user of workstation 12 is invited to participate in a multimedia conference with the user of workstation 14. The conversation manager 28 awaits acceptance in state 124 of such an invitation by the user of workstation 12. When the invitation has been accepted by the user of workstation 12, the conversation manager 28 makes a transition from state 124 to a wait state 126 where it waits for confirmation that the workstation 12 has been added to a conference, after which the conversation manager 28 makes a transition from state 126 to state 122. While a meeting is in progress and the conversation manager 28 is in state 122, additional meeting participants may be added to the conference by way of transitions between states 122, 128, 130, and 132 shown in FIG. 5. Participants may be dropped by way of transitions made between states 122 and 134 as shown in FIG. 5. Servers may be added by way of transitions between states 122 and 136 as shown in FIG. 5. Servers may also be dropped by way of transitions between states 122 and 138 as shown in FIG. 5. Any of the participants in a conference may temporarily leave a conference by placing him or herself on hold where a conversation manager, such as the conversation manager 28, enters a state 140. When a participant on hold wishes to return to the conference, the conversation manager 28 makes a transition from state 140 to state 142 and then to state 122 if the participant on hold is granted permission to re-enter the conference. One or more of the conference participants, such as the user of workstation 12, may entirely suspend the meeting whereby all participants may be placed on hold or even actually disconnected from the network 10. However, the virtual meeting room and some or all of its associated data, may persist in the network so that the meeting may be resumed at the place it was suspended. Also, storage capabilities of the media servers to be described below permit some or all of the history of the conference to be reviewed by those who are returning to the conference after the suspension. When a meeting is suspended, the conversation manager 28 makes a transition from state 122 to state 144 and then to a state 146. In resuming a meeting, the conversation manager 28 makes a transition from state 146 to a state 148 after which the conversation manager returns to the state 122. When the conversation manager is in the ground state 102, a user of the workstation 12 may inquire about the nature of the resources available in a virtual meeting room already existing in the network 10. The conversation manager makes a transition from state 102 to state 152 and the conversation manager organizes appropriate local resources to interface with the resources in the virtual meeting room. Once this has been accomplished, the conversation manager 28 then makes a transition from state 152 to state 114 and continues to operate in the manner described above in state 114 and beyond. When the conversation manager 28 is in the ground state 102, a user of the workstation 12 also may seek to enter an existing meeting which is presently going on. The user so indicates his or her desire to enter this existing meeting and the conversation manager 28 makes a transition from state 102 to state 154. In effect, the network is queried about the meeting and one of the existing meeting participants is asked to send an invitation to the user to join the meeting. When this indication is forthcoming, the conversation manager 28 then makes a transition from state 154 to state 124 and the operation of the conversation manager continues as described above. In a situation where the user of workstation 12 is already a participant in an ongoing meeting and the conversation manager 28 is in state 122, a request by another workstation user not already part of the conference made to the user of workstation 12 causes the conversation manager 28 to make a transition from state 122 to a state 156. If the user of workstation 12 sends an invitation to the newcomer, the conversation manager 28 then makes a transition from state 156 to state 130 and then back to state 122. If the user of workstation 12 refuses to invite the newcomer, the conversation manager 28 makes a transition from state 156 directly back to state 122. As shown in FIG. 5, a terminate state 158 may be entered by the conversation manager 28 from selected ones of the other states shown in FIG. 5. The terminate state 158 may be viewed as the equivalent of the ground state 102. FIG. 6 is a schematic diagram of one of the media servers shown in FIG. 1. All of the media servers may use this architecture. The media server comprises a media bridge 160 which serves to receive the respective media outputs from each conference participant. The media bridge 160 combines selected media outputs from the conference participants and directs that combination back to selected conference participants. A controller 162 manages the combination of the conferee outputs and direction of those outputs back to the conferees. In the case of an audio server, the media bridge can be any teleconferencing bridge which receives the audio outputs of each conference participant and controllably directs selected ones of those audio outputs to each of the participants. In the case of data server, the media bridge can be any data bridge, such as a windows bridge or an X windows data bridge, which receives data outputs from the conference participants and directs selected ones of those data outputs to each of the participants. Similarly, in the case of a video server, any video bridge may be used as the media bridge 160 for receiving the video outputs from the conference participants and directing selected ones of the video outputs to each of the participants. The media bridge 160 may be connected to a storage device 164 located in the network which serves to store information about various aspects of a conference in a virtual meeting room. For example, the storage device 164 may store certain video information about the conference, such as a video recording of selected parts of the conference, where the media bridge 160 is a video bridge. It may also store certain information related to computer programs which have been shared by conference participants, for example, the state of the executable program in the case where the media bridge is a data bridge. It may also store an audio recording of some or all of the conference when the media bridge is an audio bridge. The media bridge 160 may also be connected to a similar storage device 166 which is located outside the network 10. Appendix 1 is an illustrative protocol for the multimedia network 10. Appendices 2 and 3 are computer program listings representing illustrative implementations of a meeting room server .and a conversation manager described more generally above. The listings are written in the generally known C++ computer language. The programs may be compiled and executed on Sun Microsystems workstations running the well known UNIX ® operating system. These computer programs are copyrighted programs owned by the American Telephone & Telegraph Co. ( β 1993 American Telephone & Telegraph Co.) and are not to be copied except in connection with making paper copies of this patent. TABLE 1 Edge £1: Trigger: MR^CREATE_ROOM ( frαn CM) Action: Send Reply MR_CREATE_ROCK (to CM) Edge E2/E11: Trigger: MR_CREATE_MEETING (from CM) Action: Send Reply MR_CREATE_MEETING (to Ot) Edge E3/E7/E14 E18: Trigger: MR_ADD_SERVER ( from CM) Action: Send GEN_ASSOCIATE_ROOM (to appropriate Media Serrer ) Edge E4/E8 - 1/E15 E19 - 1: Trigger: Error GEN_ASSOCIATE_ROOM (from Media Server) Action: Send Error MR_ADD_SERVER (to di) Edge E5 E8 - 2 E16 E19 - 2: Trigger: Reply GEN_A≤SOCIATE_ OGM (from Media Server) Action: Send Reply MR_ADD_SEEVER (to QA) NS++ (NS - Nτιπ er " Of Servers in Room) Edge E6: Trigger: MR_DROP_SEBVER and NS - 1 Action: Send GEN_DISASSOCIATE_RO_M (to approp. Media Server) Send Reply MR_DROP_SERVER Edge E9: Trigger: MR_DESTROY_MEETING (from CM) Action: Send Reply MR_DESTROY_MEETING (to CM) Edge E10: Trigger: MR_DROP_PARTICIPANT and NP - l(from CM) (NP - Number of Participants) Action: Send Reply MR_DROP_PARTICIPANT (to CM) Edge E12: Trigger: „ ____ MR_DROP_PARTICIPANT and NP - l( frαα CM) ( NP - Number of Participants) Action : Send Reply MR_DROP_PARTICIPANT (to CM ) Edge E13 : Trigger: MRJDESTROY fflETING ( from CM) Action: Send Reply MR_DESTROY_MEETING (to CM) Edge E17: Trigger: MR_DROP_SERVER and NS - 1 Action: Send GEN_DISASSOCIATE_ROOM (to approp. Media Server) Send Reply MR_DROP_SERVER Edge E20/E22: Trigger: MR_SUSPEND_MEETING (from Oi) Action: Reply MR_SUSPEND_MEETING (to CM) Edge E21 E23: Trigger: MR_RESUME_MEETING (from CM) Action: Reply MR_RESUME_MEETING (to CM) Edge E24: Trigger: MR_DESTROY_ROOM (from CM) Action: Reply MR_DESTROY_ROOM (to CM) Edge SL1 - 1, SL2 - 1: Trigger: MR_ADD__PARTICIPANT (from CM) Action: Send Reply MR_ADD_PARTICIPANT (to CM) NP++ Edge SL1 - 2, SL2 - 2: Trigger: MR_DROP_PARTICIPANT and NP > 1 (frcm CM) Action: Send Reply MR_DROP_PARTICIPANT (to CM) NP— _..___ Edge El: TABLE " Trigger: E V E_CREXTE_MEETING (from vi ) EVB-CRΣ-ATE~PERSISTENT_MEETI3«; (frcm VI) Action: S ββ d MR_CREATE_ROOM (to MR) if (Trigger - £VE_CREATE_MEETING ) Scenario - TRANSIENT MEETING ; if (Trigger • EVEJ__REATE_PERSISTENT MEETING ) Scenario - PERSISTENT_MEETΣNG; NS - Number of Servers Edge E2: Trigger: EVE_yi_CREATE_MEET_IN_EROOM (from VI) Action: Send MR_LIST_SEKVERS Edge E3: Trigger: EVE_VI_JOIN_MEETING (from VI) Action: Send EVE_JOIN_MEETING to meeting owner Edge E4: Trigger: EVE_MEETING_INVTTE (from peer CM) Action: Send req. VI_MEETING_INVTTATION (to VI) Edge E5: Trigger: Reply MR_CREATE_ROOM (from MR) Action: Send MR_ADD_SERVER (to MR) Edge E6: Trigger: Error MR_CREATE_ROOM (from MR) Action: __ Send event EVΕ_VI_ADDED >ARTICIPANT failed (to VT) Edge E7: Trigger: Reply MR_ADD_SERVER (from MR) and NS - 0 Action: if (success) [ Send MAN_C0NNECT_70_BRIDGE to approp. Local manage } Edge E9: 94/24807 Trigger: EVE_CR£ATE_ROOM_ _SERVERS (free V I ) Action: Send MR.CRSATE ROOM (to MR) MS - Number of Servers Edge E10: Trigger: Reply MR_CREATE_MEETING success (from MR) Action: Send MRJ3ET_PERSON_INFO (to MR) Edge E12 - 1 (E12): Trigger: EVE_DROPPED_PARTICIPANT participant SELF (from a peer CM ) Action: Send EVE_DROPPED_PARTICIPANT (to VI) Edge E12 - 2 (E69): Trigger: EVE_MEETING_DESTROYED (from a peer CM) Action: _ Send EVE_MEETING_DESTROY_-_D (to VI) Edge E12 - 3 (E70): Trigger: EVE_ROOM_DESTROYED (from a peer CM) Action: Send EVE_ROCK_DESTROYED (to VI) Edge E13: Trigger: Reply MR 3ET_PERSON_INFO (from MR) Actio : Send EVB_MEETING_INVITATION to peer CM Edge E14: Trigger: Reply MR_ADD_PARTICIPANT (from MR) Action: Send event EVE_VT_ADDED PARTICIPANT success (to VI) Send event EVE_ADDED_PARTICIPANT (to all peer CM's who Edge E1S: Trigger: EVE /T_SUSP£ND_M£ETING ( from VT ) Action: Send MR_SUSPEND_MEETING (to MR) Edge E16: O 94/24807 28 Trigger: Error MR__SUSPEND_MEETING (from MR ) Action: Send EVB_MEETING_SUSPENDED fail (to VT) Edge E17: Trigger: Reply MR_SUSPEND_MEETING (from MR) Action: Send EVE_MEETING_SϋSPENDED (to all peer CMS) Send EVE_MEETING_SUSPENDED success (to VI) Edge E18: Trigger: EVE_MEETING_SUSPENDED (from a peer CM) Action: Send EVE_MEETING_SUSPENDED (to VT) Edge E19: Trigger: EVE_MEETING_R£SUMED (frcm ' a peer CM) Action: Send EVE_MEETING_RESUMED (to VT) Edge £25: Trigger: Reply VT_MEETING_INVITATION Accepted (from VI) Action: Send EVE_ACCEPT_INVITATION (to calling CM) Edge E26: Trigger: EVE_ADDE_D_PARTICIPANT participant SELF (from a peer CM; Action: Send MAN_CONNECT_TO_BRIDGE to approp. Local manager Edge E27: Trigger: Reply VT_MEETING_INVTTATION Rejected (from VI) Action: Send EVE_R£TECT_INVITATION (to calling CM) Edge E28: Trigger: EVE_MEETING_INVTTE (from peer CM) Action: Send EVE_ACCEPT_INVITATION to the requester Edge E29 Trigger: EVE_JOΣN_MEETING_RBJECTED (from peer CM) Action: Send EVE_yi_JOIN_MEETING failed (to VI ) Edge E31: Trigger: Reply MR_CREATE_ROOM (from MR) Action: Send MR_CREATE_MEETING (to MR) Edge £32: Trigger: Request EVE_CREATE_MEETING (from VT) Action: Send MRJ-XEATEJffiETING (to MR) Edge E33 : Trigger: Error MRJ__REATE_MEETING ( from MR) Action: Send event EVE_VI_ADDED_PARTICIPANT failed (to VI) Edge £34: Trigger: Reply MR_ADD_PARTICIPANT (from MR) Action: Send event EVE_VI_ADDED_PARTICIPANT success (to VI) Send event EVE_ADDED_PARTICIPANT (to all peer CM's who are Edge £37: Trigger: Error MR_ADD_PARTICIPANT (from MR) Action: Send EVE TC_ADDED_PARTICIPANT fail ( to VI) Edge £38: Trigger: EVE_ACCEPT_INVTTATION ( from peer CM) Action: Send MR_ADD__PARTICIPANT (to MR) Edge E39: Trigger: _ EVE_R£JECT_INVTTATION (f cm peer CM) Action* Send event EVE_VT_ADDED_PARTICIPANT fail (to VT) Edσe E40: Trigger: Error MR_ADD_PARTICIPANT (from MR) Action: fail (to VI) Trigger: BVE_VI_LE-WE_MEETING ( frcm VI ) Action: CM S ) Trigger: EVE.VI_REENTER_MEETING (frcm VI) Action: Send req. MR_REENTER_MEETING (to MR) Edge £43: Trigger: Reply MR_REENTER_MEETING ( from MR ) Action: Send EVE REENTER_MEETING (to all peer CM _*ι Send EVE lEENTER ffiETING success ( t-fvi ) Edge E44 : Trigger: Error MR_REENTER_MEETING (from MR) Action: Send EVE_REENTER_MEETING fail (to VT) Edge E45: Trigger: EVE_VT_REStHE_MEETING (from VI) Action: Seod MR_RESUME_MEETING (to MR) Edge E46: Trigger: Reply MR_RESUME_MEETING (from MR) Action: Send EVE ffiETING RESUMED ( to VI ) Send EVE_MEETING~RESUMED ( to all peer CMs ) Edge E47 : Trigger: Error MR__R£SUME_MEETING ( from MR) Action: Send EVE_MEETING_RΞSUMED fail ( to VT) Edge E48 : 94/24807 Trigger: EVE_VI_ΛDD_SERVER (f om VT) Action: Send req. MR_ADD_SERVER ( to MR) Edge E49: Trigger: Reply MR_ADD_SERVER ( from MR) Action: Send MAN_CONNΕET_TO_BRIDGE (to approp. local manager) Send EVE_SERVER_ADDED (to VT) Send EVE~SERVER_ADDro (to all peer CMs) Edge £50: Trigger: Error MR_ADD_SERVER (from MR) Action: Send EVE_SERVER_ADDED (fail?) (to VI) Edge ESI: Trigger: EVE_VT_DROP_SERVER (from VI) Action: Send req. MR_DROP_SERVER (to MR) Edge £52: Trigger: Reply MR_DROP_SERVER (from MR) Action: Send MAN_DISCONNECT_FRQM_BRIDGE (to approp. local manaσ Send EVE_SERVER_DROPPED (to VI) Send EVE_SERVER__DROPPED (to all peer CMs) Edge E53: Trigger: Error MRJDROP_SERVER (from MR) Action: Send EVE_SESVER_DROPPED (fail?) (to VI) Edge Ξ56: Trigger: Error MR_GET_PERSON_INFO (from MR) Action: Send event EVE_VT_ADDED_PARTICIPANT failed (to VT) Edge E57: Trigger: ^ m Reply MR_GET_?ΞRSON_INF0 ( from MR) Action: Send EVE_MEETING_INV:TAT:ON (to peer CM. Edge 258 t Trigger: OT_REJBCT_INVXTATION (frcm peer CM ) Action: Seed event 8TC_VI_ADDI_D_.PARTICIPANT failed (to VI ) Edge E59: Trigger: EVE_ACCEPT_INVITATION (from peer Of ) Action: Send MR_ADD_PARTICIPANT (to MR) Edge SELF1 (E60): 'Trigger: Reply MR_ADD_SEHVER (from MR) and NS > 0 Action: if (success) { Send MAN_CONNECT_TO_BRIDGE to approp. Local mana if (NS > 0) Send MR_ADD_SERVER (to MR) Edge SQ.F2 - 1 (E61) : Trigger: EVE_ADOED_PARTICIPANT participant NOT SELF ( frcm a peer Action: Send EVE π_ADDro_PARTICIPAHT (to VT) Edge SΞLF2 - 2 (E62) : Trigger: EVE_DROPPED_PARTICIPANT participant NOT SELF ( frcm a pee Action: Send EVE_DROPPH)_PARTICIPANT (to VI) Edge SE F2 - 3 (E63) ι Triggert ■fl_L-EFT_MEETING ( from a peer Oi) Action: Send EVE_LEFT ffiETING (to VI) Edge SELF2 - 4 (E64) : Trigger: EVE_REENTER_MEETING ( from a peer CM) Action: Send EVE_REENTER_MEETING (to VT) Edge SELF2 - 5 (E65): Trigger: EVE_SERVER__ADDED (f om a peer CM) O 94/24807 " " Action: !S_e?n_d_! SEVi£E- ^ ^SERV!ΞER r _ArΞED25E_2D RI ( D t G o 2 VT (t ) o *»wp. tx *-- manager) Send EVE_SERVER_ADDΪ-D (to all peer CM S ) Edge SELF2 - 6 (WU) x Trigger: EVE_SEKVER_DROPPED (from a peer CM) Action: Send MAN_DΣSCONNECT_FRCK_BRIDGE (to approp. local manager) Send EVE_SEHVER_DROPPED (to VT) Send EVE~SERVER~DROPPED (to all peer CMs) Edge ET1 (E67): Trigger: TiaeOut (wait for EVE_ACCEPT_INVTTATION) Action: Send EVE_yi_ADDED_PARTICIPANT fail(to VT) Edge ET2 (E68): Trigger: TiββOut (wait for EVE_MEETmS_INVITATIOH) Action: Send EVB rr_JOIN_MEEriW5 fail (to VT) Edge ET3 (E6B) : Trigger: TiaeOut (wait for EVE_ADDED_PARTICIPANT self) Action: Send EVE__VI_JOIN ffiETING fail (to VI) Edge E71: Trigger: EVE_VI_ADD_SEKVER ( from VT) Action: Send MR_ADO_SERVER (to MR) Edge E72 - 1: Trigger* Mpl *_ACD_SERVER (from MR) Action: Send MAN_COMNECT_TO_BRIDGE to approp. Local manager Edge E72 - 2: Trigger: „ _ Error MR_AEO_SHtVER (from MR) Action: None Edge E73: Trigger: EVE_VT_DROP_SEKVER (from VT) Action: . _.._._.„ 3 4 P O 94/24807 -* Send MR_D β OP_S2_RVBR ( to MR) Edge E74 - 1: Trigger: Reply MR_T_βOP_SStVER ( from MR) Actloni S β 1M_DISC Q NNECT_FR0M_.BRIDGE to approp. oc l manager Edge E74 - 2: Trigger: Error MR_DROP_SERVER (from MR) Action: None Edge E75: Trigger: EVE_VT_ADD_PARTICIPANT (from VI) Action: Send MRJ3ET_PERS0N_INP0 (to MR) Edge E76: Trigger: Error MR_GET_PERSON_INFO (from MR) Action: Send event EVE_VT_ADOED_.PARTICIPANT fail (to VI) Edge E77: Trigger: EVE__MEETIHG_SUSPENDED ( from peer Oi) Action: EVE_MEETING_SUSPENDED (to VI) Edge £78: Trigger: EVE_VT_DROP_PARTICIPANT (from VI) Action: Send MR_DBOP_PARTICIPANT (to MR) Edge E79: Trigger: ~ ' Ψ PARTICIPANT (free MR) Actioni S Λ WTE WOP PARTICIPANT (to VI) SflOd EVϊ DβOP ARTICIPANT (to all peer CMs) Edge £80: Trigger: Error MRJ»OP_PARTICIPANT (free MR) Action: None Edge £83 : Trigger • Reply MR_DROP_PARTICΣPANT ( frcm MR) && participant - SELF Action: Send EVE_DROP_PARTICIPANT ( to VI ) O 94/24807 Send EVE_DROP_PA*rcCIPA»r (to all peer CM* ) Edge E84 - 1> Trigger: aeply MR.LZST.SEKVERS from MR ActiOO: Seed >β_,CREATE_MEETING to MR Edge E85 : Trigger: Error MR_LIST_SERVERS frcm MR Action: E6 action. Edge £86 : Trigger: EVE_MEETING_JOIN (from peer CM) Action: Send EVE_VT_JOIN_MEETING (to VI) Edge E87 : Trigger: EVE_JOIN_MEETING_ACCEPTm ( from VT) Action: Send EVE_MEETING_INVITE (to peer (31) Edge £88 : Trigger: EVE.JOIMJMEETING_.REJ ECTED (frcm VI) Action: EVE_.JOIN_MEETING_REJECTm (to peer CM) aa APPENDIX I .nf H 1 "PROTOCOL BETWEEN MR SERVER AND ITS CLIENTS " H 2 "Overall Room Control" 1. CreateRoom: REQ_TXPE req_type REQUEST_MR_SEBVER REQJZODE req_code MR_CREATE__ROOM CARD32 seq_no CARD32 length CARD32 MR_id CARD32 owner ROOM_ATTRIBUTES attrib Reply-> REP_TYPE rep_type REPLY_MR_SERVER REP_CODE rep_code MR_CREATE_ROOM CARD32 seg_no CARD32 length CARD32 roαm_id Error-> REP_TYPE rep_type ERROR_MR_SERVER REP_CODE rep_code MR_CREATE ROOM CARD32 seq_no CARD32 length ERR_CODE err_code 2. DestroyRoom: REQ_TYP£ req_type REQUEST_MR_SERVER REQ__CODE req_code RM_DESTROY_ROOM CARD32 seq no CARD32 length CARD32 MR_id CARD32 src CARD32 room_id Reply- > REP_ 2?YPE rep_type REPLY_MR_SERVER REP_CODE rep_code RM_DESTR0Y_R0OM CARD32 seq_no CARD32 length Error- > REP_TYPE rep_type ERROR_MR_SERVER REP_CODE rep_code RM DESTROY ROOM CARD32 seqjio CARD32 length ERR_CODE err_code . ListRooms : REQ_TYPE req_type REQUEST_MR_SERVER REQ_CODE req_code MR LIST ROOMS CARD32 seq_no CARD32 length CARD32 MR_id CARD32 src LY_MR_SERVER LIST ROOMS Error-> REP_T PE rep_type ERROR_MR_SERVER REP_CODE rep~code MR LIST ROWS CARD32 seqjao CARD32 length ERR CODE err code 4. ShσwRoomStatus: REQ_TYPE req_type REQUEST_MR_SERVER REQ_C0DE req_code MR_SHOW_RO Q M_STATUS CARD32 seq_no CARD32 length CARD32 MR_id CARD32 src CARD32 roam id Reply-> REP_TYPE rep_type REPLY_MR_SERVER REP_C0DE rep__code MR SHOW ROOM STATUS CARD32 s&q ao CARD32 length STATUS status LOCK_STATUS lock_status CARD32 list_length L MEDIA SERV INFO media list Error-> REP_TYPE rep_type ERROR_MR_SERVER REP_CODE rep_code MR_SHOW_ROOM_STATUS CARD32 seq_no CARD32 length ERR CODE err code ShσwRoomA triiiute≤: REQ_TYPE req_type REQUEST_MR_SERVER REQ_CODE req_code MR SHOW ROOM ATTRIBUTES CARD32 seq_no CARD32 length CARD32 MR_id CARD32 src CARD32 roam id Reply-> REP_TYPE rep__type REPLY_MR_S£RVER REP_CODE rep_code MR SHOW ROOM ATTRIBUTES CARD32 seq_no CARD32 length ROOM ATTRIBUTES attrib Error-> REP_TYPE rep_type ERROR_MR_SERVER REP_CODE rep_code MR SHOW ROOM ATTRIBUTES CARD32 se<ι_no CARD32 length ERR CODE err code AlterRoomAttributes: REQ_TYPE req_type REQUEST_MR_SERVER REQ_CODE req_code MR ALTER ROOM ATTRIBUTES CARD32 seq_no CARD32 length CARD32 MR_id CARD32 src CARD32 roσm_id ROOM ATTRIBUTES attrib Reply-> REP_TYPE rep_type R£PLY_MR_SEKVER REP_CODE rep_code MR_ALTER_ROOM_ATTRIBUTES CARD32 seq_no CARD32 length Error-> REP_TYPE rep_type ERROR_MR_SERVER REP_CODE rep_σode MR_ALTER_ROOM_ATTRIBUTES CARD32 seq_no CARD32 length ERR CODE err code Reply-> REP_TYPE rep_type REPLY_MR_SEEVER REP_C0DE rep_code MR LOCK ROOM CARD32 seg__no CARD32 length Error—> REP_TYPE rep_type ERROR_MR_SEEVER REP_CODE rep_code MR LOCK ROOM CARD32 seq_no CARD32 length ERR CODE err code Reply-> REP_TYPE rep_type REPLY_MR_SERVER REP_CODE rep_code MR UNLOCK ROOM CARD32 seq ao CARD32 length Error-> REP_TYPE rep_type ΞRROR_MR_SERVER REP_CODE rep_σode MR UNLOCK ROOM CARD32 seq_no CARD32 length ERR CODE err code .H 3 "Overall Meeting Control" 1. CreateMeeting: REQJTYPE req_type REQUEST_MR_SERVER REQ_CODE req_code MR CREATE MEETINC CARD32 seq_no CARD32 length CARD32 MR id CARD32 src CARD32 roαm_id MEETING_ATTRIBUTES attrib Reply-> REP_TYPE•rep_type REPLY_MR_SERVER REP~CODE rep_code MR_CREATE MEETING CARD32 seqjαo CARD32 length CARD32 meeting_id Error-> REP_TYPE rep_type ERROR_MR_SERVER REP~CODE rep_code MR CREATE MEETING CARD32 seq_no CARD32 length ERR CODE err code 2. DestroyMeeting: REQ_TYPE req_.type REQUEST_MR_SERVER REQ C0DE re code MR DESTROY MEETING REPLY_MR_SERVER MR_DESTROY_MEETING Error-> REP_TYPE rep_type ERROR_MR_SERVER REP_CODE rep_code MR DESTROY MEETING CARD32 seq_no CARD32 length ERR CODE err code 3. ListMeetings: REQ_TYPE req_type REQUEST_MR_SERVER REQ_CODE req_code MR LIST MEETINGS CARD32 seq_no CARD32 length CARD32 MR_id CARD32 src Reply-> REP_TYPE rep _type REPLY_MR_SERVER REP_CODE rep_code MR LIST MEETINGS CARD32 seq_no CARD32 length CARD32 list_length MEETING list_of_meetings Error-> REP_TYPE rep_type ERROR_MR_SERVER REP_CODE rep_code MR LIST MEETINGS CARD32 seq_no CARD32 length ERR CODE err code 4. ShσwMeetingStatus: REQ_TYPE req_type REQUEST_MR_SE Vi_-R REQ_CODE req_code MR_SHOW_MEETING_S!__ATUS CARD32 seq_no CARD32 length . CARD32 MR_id CARD32 src CARD32 meeting_id Reply-> REP_TYPE rep_type REPLY 4R_SEKVER REP_CODE rep_code MR_SHOW_MEETING_STATUS CARD32 seq_no CARD32 length CARD8 status CARD32 roαm_id CARD32 owner CARD32 list_length L_PART_SERV part_serv_list Error-> REP_TYPE rep_type ERROR_MR_SERVER REP_CODE rep_code MR_SHOW_MEETING_STATUS CARD32 seq_no CARD32 length ERR_CODE err_code 4. ShowMeetRoαmStatus: REQ_TYPE req_type REQUEST_MR_SERVER REQ_CODE req_code MR_SHOW_MEETROOM_STATUS CARD32 seq_no CARD32 length CARD32 MR_id CARD32 src CARD32 roαm_id Reply-> REP_TYPE rep_type REPLY_MR_SERVER REP_CODE rep_code MR_SHOW_MEETING_STATUS CARD32 seq_no CARD32 length CARD8 status CARD32 meeting_id CARD32 owner CARD32 list_length L_PART_SEKV part_serv_list Error-> REP_TYPE rep_type ERROR_MR_SERVER REP_CODE rep_code MR_SHOW_MEETING_STATUS CARD32 seq__no CARD32 length ERR_CODE err_code 5. ShowMeetingAttributes: REQ_TYPE req_type REQDEST_MR_SERVER REQ_CODE req_code MR_SHOW_MEETING_ATTRIBUTES CARD32 seq_no CARD32 length CARD32 MR_id CARD32 src CARD32 meeting_id Reply-> REP_TYPE rep_type REPLY_MR_SERVER REP_CODE rep_code MR_SHOW_MEETING_ATTRIBUTES CARD32 seσ no CARD32 length MEETING ATTRIBUTES attrib Error- > REP_TYPE rep_type ERROR_MR_SEEVER REP_CODE rep_code MR_SHOW_MEETING_ATTRIBUTES CARD32 seg_no CARD32 length ERR CODE err code AlterMeetingAt tributes : REQ_TYPE req_type REQUEST_MR_SERVER REQ_CCDE req_code MR_ALTER_MEETING_ATTRIBUTES CARD32 seq_no CARD32 length CARD32 MR_id CARD32 src CARD32 meeting_id MEETING_ATTRIBUTES attrib Reply- > REP_TYPE rep_type REPLY_MR_SERVER REP_CODE rep_ccde MR_ALTER_MEETING ATTRIBUTES CARD32 seqjao CARD32 length Error-> REP_TYP£ rep_type ERROR_MR_SERVER REP_CCDE rep_code MR_ALTER MEETING ATTRIBUTES CARD32 seq_no CARD32 length ERR CODE err code 7. AddParticipant: REQJTYPE req_type REQUEST_MR_SERVER REQ_CODE req_code MR ADD PARTICIPANT CARD32 seq_no CARD32 length CARD32 MR_id CARD32 src CARD32 meeting_id PARTICIPANT participant Reply-> REP_TYPE rep_type REPLY_MR_SERVER REP_CODE rep_code MR ADD PARTICIPANT CARD32 seq ao CARD32 length Error- > REP_TYPE rep_type ERROR_MR_SERVER REP_CODE rep_ccde MR ADD PARTICIPANT CARD32 seq_no CARD32 length ERR CODE err code 3. DropParticipant: REQJTYPE req_type REQUEST_MR_SERVER REQ_CODE req_code MR DROP PARTICIPANT CARD32 seqjao CARD32 length CARD32 MR_id CARD32 src CARD32 -i_eeting_id PARTICIPANT participant Reply- > REP_TYPE rep_type REPLY_MR_SERVER REP_CODE rep_coάe MR_DROP_PARTICIPANT CARD32 seq_no CARD32 length Error-> REP_TYPE rep_type ERROR MR_SERVER REP_CODE rep_ccde MR_DROP_PARTICIPANT CARD32 seqHno CARD32 length ERR CODE err code 9. LeaveMeeting: REQUEST_MR_SERVER MR LEAVE MEETING CARD32 meeting_id CARD32 list_length L MEDIA media list Reply-> REP_TYPE rep_type REPLY_MR_SEKVER REP_CODE rep_code MR_LEAVE MEETING CARD32 seqjao CARD32 length Error-> REP TYPE rep_type ERROR_MR_SERVER REP CODE rep~code MR_LEAVE MEETING CARD32 seq^no CARD32 length ERR CODE err code 10. ReenterMeeting: REQJTYPE req_type REQUEST_MR_SERVER REQ CODE re code MR REENTER MEETING EPLY_MR_SEHVER R REENTER MEETING Error- > ERROR_MR_SEHVER MR REENTER MEETING 11. SuspendMeeting: REQ_TYPE req_type REQUEST_MR_SERVER REQ_CODE req_code MR SUSPEND MEETII" CARD32 seq_no CARD32 length CARD32 MR_id CARD32 src CARD32 meeting_id Reply-> REP_TYPE rep_type REPLY_MR SERVER REP_CODE rep_code MRJSUSPEMDJMEETING CARD32 seq_no CARD32 length Error-> REP TYPE rep_type ERROR_MR_SERVER REP__CODE rep_ccde MR_SUSPEND_MEETING CARD32 seq_.no CARD32 length ERR_CODE err_code 12. ResumeMeeting: REQ_TYPE req_type REQUEST_MR_SERVER REQ CODE re code MR RESUME MEETING REPLY_MR_SEKVER MR_RESUMEJMEETING Error-> REPJTYPE rep_type ERRORJR_SE KR REP_CODE rep_ccde MR_RESUME_MEETING CARD32 seq_no CARD32 length ERR_CODE err_ccde .H 2 "Meeting Association with a Room" ShσwAssociatedRoαm: REQ_TYPE req_type REQUEST_MR_SERVER REQ CODE reσ code MR SHOW ASSOCIATED ROOM REPLY_MR_SERVER MR SHOW ASSOCIATED ROOM Error-> REPJTYPE rep_type ERR0RJRJ3ERVER REP__CODE rep_code MR SHOW ASSOCIATED ROOM CARD32 seq_no CARD32 length ERR CODE err code 2. ShαwAssociatedMeeting: REQJTYPE req_type REQUES R_SERVER REQ_CODE req_code MR_SHσW_ASSOCIATED_MEETING CARD32 seq_no CARD32 length CARD32 MR_id CARD32 src CARD32 roomjid Reply-> REPJTYPE rep_type REPLY_MR_SEHVER REP_C0DE rep_code MR_SHOW_ASSOCIATED MEETING CARD32 seq__no CARD32 length CARD32 meeting_id Error-> REPJTYPE rep_type ERRORJR_SERVER REPjCODE rep_code MR_SHOW_ASSOCIATED MEETING CARD32 seq_no CARD32 length ERR CODE err code .H 2 "Media Server Associations With a Room" 1. AddServer: REQ_TYPE req_type REQUEST_MR_SERVER REQ_CODE req_code MR ADD SERVER ' CARD32 seq_no CARD32 length CARD32 src CARD32 roomjid MEDIA server STRING usex_desc CARD32 list_length L_PARTICIPANT participant_list Reply-> REPJTYPE rep_type REPLY_MR_SERVER REP_CODE rep_code MR ADD SERVER CARD32 seq_no CARD32 length SERV CONN conn Error-> REPJTYPE rep_type ERROR RJ3ERVER REPjCODE rep_code MR ADD SERVER CARD32 seq_no CARD32 length ERR CODE err code REQUEST_MR_SERVER MR DROP SERVER Reply-> REPJTYPE rep_type REPLY_MR_SERVER REP_C0DE rep_code MR DROP SERVER CARD32 seq_no CARD32 length Error-> REPJTYPE rep_type ERR0R_MRJ3ERVER REP_CODE rep_code MR DROP SERVER CARD32 seq_no - CARD32 length ERR CODE err code SetServerAccessList REQ_TYPE req_type REQUEST_MR_SERVER REQ_CODE req_code MR_SET_SERVERJ^CCESS_LIST CARD32 seq_.no CARD32 length CARD32 src CARD32 roomjid MEDIA server CARD32 list_length L_PARTICIPANT participant_list Reply-> REP_TYPE rep_type REPLYJR_SERVKR REP_C0DE rep~code MR_SET_SERVER_ACCESS_LIST CARD32 seqjao CARD32 length Error-> REP_TYPE rep_type ERROR_MR_SERVER REP_C0DE rep~code MR__SET_SERVER_ACCESS_LIST CARD32 seq_no CARD32 length ERR CODE err code 4. ListServers: REQJTYPE req_type REQUEST_MR_SERVER REQ_C0DE req_code MR LIST SERVERS CARD32 seq_.no CARD32 length CARD32 src CARD32 room id Reply-> REPJTYPE rep_type REPLY_MR_SERVER REP_C0DE rep__code MR LIST SERVERS CARD32 seq__no CARD32 length CARD32 list_length L MEDIA server list Error-> REPJTYPE rep_type ERROR_MR_SERVER REP_CODE rep_code MR LIST SERVERS CARD32 seg__no CARD32 length CARD32 err code 5. GetServerlnfo : REQ_TYPE req_type REQUEST RjsERVER REQ_CODE req_code MR GET SERVER INFO CARD32 seq_no CARD32 length CARD32 src MEDIA server STRING user desc Reply-> REPJTYPE rep_type REPLY_MR_SERVER REP CODE reD code MR GET SERVER INFO CARD32 seq_no CARD32 length SERVJCONN conn Error—> REPJTYPE rep_type ERROR_MR_SERVER REP_CODE rep_Cθde MR_GET_SERVER_INFO CARD32 seq_no CARD32 length ERR_C0DE err_ccde .H 2 "Name Service Messages" 1. CreateUser : REQJTYPE req_type REQUEST_REGISTRY_SERVER REQ_CODE req_code REG_CREATE_USER CARD32 seq_no CARD32 length STRING name CONN LIST connection_list Reply-> REPJTYPE rep_type REPLY_REGISTRY_SERVER REPJZODE rep_code REG_CREATE_USER CARD32 seq_no CARD32 length CARD32 id ID Error- i > REPJTYPE rep_type ERROR_REGISTRY_SERVER REP_CODE rep_code REG_CREATE_USER CARD32 seq_no CARD32 length ERR_CODE err_code 2. CreateDuplicateUser : REQJTYPE req_type REQUEST_REGISTRY_SERVER REQ_CODE req_code REG_CR£ATE_DUP_USER CARD32 seq_no CARD32 length CARD32 ID STRING name CONNJ1IST connection_list Reply-> REP_TYPE rep_type REPLY_REGISTRY_SERVER REP_CODE rep_code REG_CREATE_DUP_USER CARD32 seqjQO CARD32 length Error-> REPJTYPE rep_type ERROR_REGISTRY_SERVER REP_CODE rep_code REG_CREATE_DUP_USER CARD32 seqjao CARD32 length ERR_CODE err_code 3. DeleteUser : REQJTYPE req_type REQUEST_REGISTRY_SERVΕ_R REQ_C0DE req_code REG_DELETE_USER CARD32 seq_no CARD32 length CARD32 ID CONN_LIST connection_list Reply-> REPJTYPE rep_type R£PLY_REGISTRY_SERVER REP_CODE rep_code REG CHANGE USER CARD32 seqjao CARD32 length Error-> REPJTYPE rep_type ERROR_REGISTRY_SERVER REP ZODE rep_code REG CHANGE USER CARD32 seq_.no CARD32 length ERR CODE err code GetPersonlnfo : REQJTYPE reg type REQUEST_REGISTRY_SERVER REQ_CODE req_code REG GET PERSON INFO CARD32 secL.no CARD32 length CARD32 part_id ID Reply> REPJTYPE rep_type REPLY_REGISTRY_SERVER REP_CODE rep_code REG GET PERSON_INFO CARD32 seq_no CARD32 length CARD32 part ld STRING name CARD32 list_length L NM CONNECTIONS list of all connections Error-> REPJTYPE rep_type ERROR_REGISTRY_SERVER REP_CQDE rep_code REG GET PERSON INFO CARD32 seqjno CARD32 length ERR CODE err code 5. CreateNMEntry: REQJTYPE reqjzype REQUΞST_REGISTRY_SERVER REQ_CODE req_code REG CREATE NM ENTRY CARD32 seqjao CARD32 length NM_ADDR nm_address RANGE_ID range Reply-> REPJTYPE rep_type REPLY_REGISTRY_SERVER REP_CODE rep_code REG CREATE NM ENTRY CARD32 seq_no CARD32 length Error-> REPJTYPE rep_type ERROR_REGISTRY_SEKVER REP_CODE rep_code REG CREATE NM ENTRY CARD32 seq_.no CARD32 length ERR CODE err code DeleteNMEntr : REQJTYPE req_type REQUEST_REGISTRY_SERVER REQjCODE req_code REG DELETE NM ENTRY CARD32 seq_no CARD32 length NM ADDR nm address Reply-> REPJTYPE rep_type REPLY_REGISTRY_SEKVER REP JZCSDΣ rep_code RBG_DE___ETE_NM_ENTRY CARD 2 seqjao CARD32 length Error-> REPJTYPE rep_type ERROR_REGISTRY_SERVER REP_C0DE rep code REG_DELETE_NM_ENTRY CARD32 seqjao CARD32 length ERR_CODE err_code 7. GetNMEntry: REQJTYPE req_type REQUEST_REGISTRY_SΞRVER REQ_CODE req_ccde REG_GET_NM_ENTRY CARD32 seqjao CARD32 length CARD32 id Reply-> REPJTYPE rep_type REPLY_REGISTRY_SERVER REP_CODE rep_code REG_GET_NM_ENTRY CARD32 seqjao CARD32 length NM_ADDR π_jn_address Error-> REPJTYPE rep_type ERROR_REGISTRY_SERVER REP_CODE rep~code REG_GET_NM_ENTRY CARD32 seqjao CARD32 length ERR_CODE err_ccde 8. GetPhonelnfo : REQJTYPE req_type REQUEST_REGISTRY_SERVER REQ ZODE req_code REG_GET_PHONE_INFO CARD32 seq_no CARD32 length CARD32 part_id ID Reply-> REPJTYPE rep__type REPLY_REGISTRY_SERVER REP_CODE rep__code REG_GET_PHONE_INFO CARD32 seq_.no CARD32 length CARD32 part_id STRING name CARD32 list_length L_PHONE_C0NNECTIONS list_of_aHj3hone_numbers Error-> REPJTYPE rep_type ERROR_REGISTRY_SERVER REP CODE rep_code REG 3ET PHONE_INFO CARD32 seq_.no CARD32 length ERR_CODE err_code GetVideoClassInfo : // Return info about all devices with class_id, par REQ_TYPE req_type REQUEST_REGISTRY_SERVER REQ CODE req_code REG_GET_VTDE0_CLASS_INFO CARD32 seq__no CARD32 length CARD32 participant_id //-ve pid means return with only class id as ma CARD32 class_id ~ Reply-> REPJTYPE rep__type REPLY_REGISTRY_SERVKR REP_CODE rep_code REG_GET_VTDEO__CI_ASS_INFO CARD32 seq_no CARD32 length . CARD32 list_length L_VTDEO CONNECTIONS list_of_all_video_conns Error-> REPJTYPE rep_type ERROR_REGISTRY_SERVER REP_CODE rep~code REG 3ET_VIDEO_CLASS_INFO CARD32 seq_no CARD32 length CARD32 participant_id ERR CODE err_code GetVideoDevInfo : REQJTYPE req_type REQUEST_REGISTRY_SERVER REQ_CODE req_code REG_GET_VTDEO_DEV_INFO CARD32 seq_no CARD32 length CARD3 vid Reply-> REPJTYPE rep_type REPLY_REGISTRY_SERVER REP_C0DE rep__code R£G_GET_VTDE0_DEV_INFO CARD32 seqjao CARD32 length VTDEO_LIST vid_list Error-> REPJTYPE rep_type ERROR_REGISTRY_SERVER REP CODE rep_code REG_GETJVIDEO_DEV_INFO CARD32 seq_.no CARD32 length ERR_C0DE err_code 9. GetVideoDeviceList REQJTYPE req_type REQUEST_REGISTRY_SERVER REQ_C0DE req_code REG_GET_VTDEO_DEV_LIST CARD32 seq_no CARD32 length Reply-> REPJTYPE rep_type REPLY_REGISTRY_SERVER REP_C0DE rep_code REGjSET_VTDEO_DEV_LIST CARD32 seq_no CARD32 length VIDEO_LIST vid_list Error-> REP_TYPE rep_type ERROR_REGISTRY_SERVER REP_C0DE rep_code REG_GET_VTDEO_DEV_INFO CARD32 seq no CARD32 length ERR CODE err_code .H 1 "Protocol between Conversation Managers" .H 2 "Requests" 1. ShowAssociatedRoom: REQJTYPE req_type REQUEST_CM REQ_C0DE req_code CM ^ SHOW_ASSOCIATED_ROOM CARD32 seqjao CARD32 length CARD 2 src CARD32 π_eet-Lng_id Reply- > REPJTYPE rep_type R£PLY_CM REP_C0DE req_COde CM_SHOW_ASSOCIATED_ROOM CARD32 seqjao CARD32 length CARD32 src CARD32 roomjid Error- > REPJTYPE rep_type REPLY_CM REP_CODE req_code CM_SHOW_ASSOCIATED_ROOM CARD32 seq_.no CARD32 length ERR_C0DE err_ccde 2. ShowAssociatedMeeting: REQ_TYPE req_type REQUEST_CM REQ_C0DE req_code CM_SHOW_ASSOCIATED_MEΞTING CARD32 seq_no CARD32 length CARD32 src CARD32 room_id Reply-> REP_TYPE rep_type REPLY_CM REP_CODE req_code CM_SHOW_ASSOCIATED_MEETING CARD32 seq_no CARD32 length CARD32 src CARD32 π_eeting_id Error-> REPJTYPE rep_type REPLY_CM REP_C0DE req_σode CM_SHOW_ASSOCIATED__MEETING CARD32 seq_no CARD32 length ERR_C0DE err_code .H 2 "Events" 1. EveMeetingInvite: REQJTYPE req_type EVENT_CM REQjODE req_code EVE_MEETING_INVTTE CARD32 seqjio CARD32 length CARD32 src STRING srcjaame CARD32 room_id CARD32 meeting id CARD32 list_length L_MEDIA server_list CARD32 list_length L_PART_MED_INFO part_list 2. EveAcceptlnvitation : REQJTYPE req_type EVENT_CM REQ_C0DE req_code EVE_ACCEPT_I VTTATION CARD32 seq_no CARD32 length CARD32 src CARD32 room_id CARD32 meeting_id CARD32 list_length L MEDIA server .list 3 . EveMeetingJoin : REQJTYPE req_type EVENT_CM REQ_C0DE req_code EVE MEETING JOIN CARD32 seq_no CARD32 length CARD32 src CARD32 roomjid CARD32 meeting__id 4 . EveAddedParticipant : REPJTYPE rep_type EVENT_CM REP C0DE re ccde EVE ADDED PARTICIPANT 9. EveReenterMeeting: REPJTYPE rep type _-TVENT_CM REP CODE re code EVE REENTER MEETING 10. 11. EveMeetingResumed : REPJTYPE rep_type EVENT_CM REP_C0DE rep~code EVE_MEETING_RESUMED CARD32 seqjao CARD32 length CARD32 src CARD32 room_id CARD32 meeting_id 12. EveServerAdded: REPJTYPE rep_type EVENT_CM REP_C0DE rep_code EVE SERVER ADDED CARD32 seqjao CARD32 length CARD32 src CARD32 room_id CARD32 meeting_id MEDIA_SERV_INFO media_info CARD32 list_len L_PARTICIPANT part_list // participant list who have access 13. EveServerDropped: REP_TYPE rep type EVENT_CM REP_CODE rep_code EVE SERVER DROPPED CARD32 seq_no CARD32 length CARD32 src CARD32 room_id CARD32 meeting_id 14. EveRoomLoclced: REPJTYPE rep_type EVENT_CM REP_C0DE rep_code EVE ROOM LOCKED CARD32 seqjao CARD32 length CARD32 src CARD32 rocm__id 16. EveRoαmUnoc ed: REPJTYPE rep_type EVENT_CM REP_C0DE rep_code EVE ROOM UNLOCKED CARD32 seq_no CARD32 length CARD32 src CARD32 room id 17. EveServerAccessListSet: REP_TYPE rep_type EVENT_CM REP CODE re code EVE_SERVER_ACCESS_LIST_SET _ par _ ist //list of participants granted access 18. EveServerAccessDenied: REPJTYPE rep_type EVENT_CM REP_C0DE rep~code EVE_SERVER_ACCESS_DENIED CARD32 seq io CARD32 length CARD32 src MEDIA media number STRING media name CARD32 participant 19. EveRejectInvitation: REPJTYPE rep_type EVENT ^ CM REP_C0DE rep_code EVE REJECT INVITATION CARD32 seq_no CARD32 length CARD32 src CARD32 room_id CARD32 meeting_id .H 1 "Media Server Messages" .H 2 "Generic Requests to Media Servers" 1. AssociateServer: REQJTYPE req ype REQUEST_GEN_SERVER REQ CODE req_ccde GEN ASSOCIATE SERVER CARD32 seq_no CARD32 length CARD32 roomjid Reply-> REPJTYPE rep_type REPLY_GEN_SERVER REP_CODE rep_code GEN ASSOCIATE SERVER CARD32 seq_no CARD32 length CARD32 port Error-> REPJTYPE rep_type ERROR GEN_SERVER REP_C0DE rep_ccde GEN ASSOCIATE SERVER CARD32 seq_no CARD32 length ERR_C0DE err_code 2. DisassociateServer: REQJTYPE req_type REQUEST_GEN_SERVER REQjCODE req_code GEN DISASSOCIATE SERVER CARD32 seq_.no CARD32 length CARD32 room_id Reply-> REPJTYPE rep_type REPLY_GEN_SERVER ' REPJZODE rep_code GEN DISASSOCIATE SERVER CARD32 seq_no CARD32 length Error-> REP_TYPE rep_type ERROR_GEN_SERVER REP_C0DE rep__code GEN_DISASSOCIATE_SERVER CARD 32 seq_no CARD32 length ERR CODE err code 3 . SetAccessList : REQJTYPE req_type REQUEST_GEN_SEKVER REQ_CODE req_code GEN SET ACCESS LIST CARD32 seq_.no CARD32 length CARD32 room_id CARD32 list_length L_PARTICIPANT participant_list Reply-> REP_TYPE rep_type REPLY_GEN_SERVER REP_CODE rep__code GEN_SET_ACCESS_LIST CARD32 seq_.no CARD32 length Error-> REPJTYPE rep_type ERROR_GEN_SERVER REP_CODE rep__code GEN_SET_ACCESS_LIST CARD32 seq_no CARD32 length ERR CODE err code .H 2 "Events from MR Server to Media Servers" EveAddedParticipant REPJTYPE rep_type EVENT_MR_SERVER REP CODE rep_code EVE_ADDED_PARTICIPANT CARD32 seq_.no CARD32 length CARD32 roomjid CARD32 meetingjld CARD32 participant 2. EveDroppedParticipant: REPJTYPE rep_type EVENT_MR_SEKVER REP_CODE rep__code EVE_DROPPED_PARTICIPANT CARD32 seqjao CARD32 length CARD32 roomjid CARD32 meetingjld CARD32 participant 3. EveMeetingCreated: REP_TYPE rep_type EVENTJMRJ3ERVER REP_CODE rep__ccde EVE MEETING CREATED CARD32 seq_no CARD32 length CARD32 room__id CARD32 meeting_id 4. EveMeetingDestroyed: REPJTYPE rep_type ΞVENT_MR_SERVER REP_CODE rep_code EVE MEETING DESTROYED CARD32 seq_no CARD32 length CARD32 roomjid CARD32 meetingjld 5. EveRoomDestroyed :. REPJTYPE rep_type EVENT_MR_SERVER REP_CODE rep__code EVE_ROOM_DESTROYED CARD32 seq_no CARD32 length CARD32 src CARD32 room_id 6. EveLeftMeeting: REPJTYPE rep_type EVENT_MR_SEEVER REP_CODE rep_code EVEJ EFT_MEETING CARD32 seqjao CARD32 length CARD32 roomjid CARD32 meeting_id CARD32 person_id 7. EveReenterMeeting: REPJTYPE rep__type EVENTjR_SERVER REP_C0DE rep__code EVEJREENTERJEETING CARD32 seqjao CARD32 length CARD32 roomjid CARD32 meetingjld CARD32 person_ϊd 8. EveMeetingSuspended: REP_TYPE rep_type EVENT_MR_SKKVKR REP_CODE rep_code EVE_MEETINGJ3USPENDED CARD32 seq_.no CARD32 length CARD32 roαm_id CARD32 meeting_id 9. EveMeetingResumed: REP_TYPE rep__type EVENT_MR_SERVER REP_C0DE rep__code EVE_MEETING_RESUMED CARD32 seq_.no CARD32 length CARD32 roαm_id CARD32 eeting_id .H 2 "X BRIDGE MESSAGES' 1. CreateApplication : REQJTYPE req_type REQUEST_X_BRIDGE REQ_CODE req_code X_CREATE_APPL CARD32 seq_no CARD32 length CARD32 src CARD32 roomjid CARD32 machine STRING appl_name /* application attribs here '/ Reply-> None Error-> REPJTYPE rep_type ERROR_X_BRIDGE REP_CODE rep_code X_CREATE_APPL CARD32 seq_no CARD32 length ERR_CODE err_co e 2. A≤sociateApplication REQJTYPE reσ_type REQUEST_X_BRIDGE REQ_C0DE req_code X_ASSOCIATE_APPL CARD32 seq_no CARD32 length CARD32 src CARD32 room_id APPL_3D appl_id Reply-> None Error-> REPJTYPE rep_type ERROR_X_BRIDGE REP CODE rep_code X_ASSOCIATE_APPL CARD32 seq_no CARD32 length ERR_C0DE err ^ code 3. DisassociateApplication REQJTYPE req_type REQUEST X_BRIDGE REQ_CODE req_code X_DISASSOCIATE_APPL CARD32 seq_no CARD32 length CARD32 src APPL_ID appl_id Reply-> None Error-> REPJTYPE rep_type ERROR_X BRIDGE REP CODE rep_code X_DISASSOCIATE_APPL CARD32 seq_no CARD32 length ERR_CODE err_σode DestroyApplication REQJTYPE req_type REQUEST_X_BRIDGE REQ_CODE req_code X_DESTROY_APPL CARD32 seq_.no CARD32 length CARD32 src APPL_ID appl_id Reply-> None Error-> REPJTYPE rep_type ERROR_X_BRIDGE REP_C0DE rep_ccde X DESTROY APPL CARD32 seq_no CARD32 length ERR__C0DE err_code 5. SetlnputFilter : REQJTYPE req_type REQUEST_X_BRIDGE REQ_C0DE req_code X_SET_INPUT CARD32 seq_no CARD32 length CARD32 src APPL_ID appl_id CARD32 list_length LJ?ART_INMODE part_mode_list Reply- > None Error- > REPJTYPE rep type ERROR_X_BRIDGE REPJZODE rep__code X_SET_INPUT CARD32 seqjao CARD32 length ERR_CODE err_code 6. SetOut utFilter : 7. GetApplicationStatus : REQJTYPE req_type REQUEST_X_BRIDGE REQ_CODE req_code X_APPL_STATUS CARD32 seq_no CARD32 length CARD32 src APPL_ID appl_id Reply-> REPJTYPE rep_type REPLY_X_BRIDGE REP ZODE rep_code X APPL STATUS CARD32 seq_no CARD32 length APPL_STATUS appl_stat Error-> REPJTYPE rep_type ERROR_XJ3RIDGE REP_CODE rep_code X APPL STATUS CARD32 seqjao CARD32 length ERR CODE err code 8. ListApplicationsInRoαm REQJTYPE req_type REQUEST_X_BRIDGE REQ_CODE req_code X LIST ROOM APPLS CARD32 seq_no CARD32 length CARD32 src CARD32 room id Reply-> REPJTYPE rep_type REPLY_X_BRIDGΞ REP_CODE rep_code X LIST ROOM APPL? CARD32 seq_no CARD32 lenσth CARD32 list_length L APPL appl_list Error-> REPJTYPE rep_type ERROR_X_BRH ) GE REP_CODE rep_code Σ_LIST_ROOM_APPLS CARD32 seq_.no CARD32 length ERR CODE err code .H 2 "Requests from X Bridge to local x managers" 1. StartApplication : REQJTYPE req type REQUEST_LOCALX REQ C0DE re code LOCX START APPL Error-> REPJTYPE rep_type ERROR_LOCALX REP_CODE rep__code LOCX START APPL CARD32 seq_.no CARD32 length ERR CODE err code REQUEST_LOCALX LOCX KΣLL APPL ,H 2 "Events from X Bridge to local X managers" EveApplicationAdded REPJTYPE rep__type EVENT_X_BRIDGE REP CODE rep_code EVE X APPL ADDED CARD32 seq_no CARD32 length APPL_ID aρpl_id 2. EveApplicationAssociated : REPJTYPE rep_type EVENT_X_BRIDGE REP CODE rep_code EVE__X_APPL_ASSOCIATED CARD32 seq_no CARD32 length APPL_ID appljld 3. EveApplicationDestroyed REPJTYPE rep_type EVENT_X_BRIDGE REP_CODE rep code EVE_X_APPL_DESTROYED CARD32 seq_no CARD32 length . APPL_ID aρpl_id 4. EveApplicationDisassociated : REPJTYPE rep_type EVENT_XJ3RIDGE REP_CODE rep_code EVE_X_APPL_DISA≤SOCIATED CARD32 seqf.no "" CARD32 length APPL_ID appl_id 5. EvelnputFilterSet : REPJTYPE rep_type EVENT_X_BRIDGE REP_C0DE rep__code EVE_X_INPUT_SET CARD32 seq_no CARD32 length APPL ID appljld APPL~M0DE mode 6. EveOutputFilterSet : REP_TYPE rep_type EVENT_X_BRIDGE REP_CODE rep_code EVE_X__OUTPUT_SET CARD32 seqjao CARD32 length APPL ID appljld APPL^MODE mode .H 2 "VIDEO BRIDGE MESSAGES" .H 3 "Protocol between Video Bridge and Local Video Manager" 1. Input filter: REQJTYPE req_type REQUEST 7TDEOJ3RIDGE REQ_C0DE req_ccde VID_INPUT_FILTER CARD32 seqjao CARD32 length CARD32 roomjid CARD32 src ID CARD32 list_length L_INP_FILT filt_paxticipants Reply-> None Error-> REPJTYPE rep_type ERROR_VTDE0_BRIDGE REP_C0DE rep_ccde VTD_INPUT_FILTER CARD32 seq_no CARD32 length ERR_C0DE err_code 2. Output_filter: REQ_TYPE req_type REQUEST_VTDEO_BRIDGE REQ_C0DE req_ccde VTD_OUTPUT_FILTER CARD32 seq_no CARD32 length CARD32 roomjid CAKD32 src ID CARD32 list_length L_INP_FILT filtjaarticipants Reply-> x : ne Error-> REPJTYPE rep_type ERRORJ7IDE0J3RIDGE REP_CODE rep_code VTD_OUTPUT_FILTER CARD32 seq_no — CARD32 length ERR_CODE err_code 3. Start_logging: REQJTYPE req_type REQUEST 7IDE0_BRIDGE REQ__CODE req_code VTD_START_LOGGING CARD32 seq_no CARD32 length CARD32 room_id CARD32 src ID STRING log__params Reply-> None Error-*> REPJTYPE rep_type ERROR_VTDEO_BRIDGE REP_CODE rep_code VTD_START_LOGGING CARD32 seq_no CARD32 length ERR CODE err_code 4. Stop_logging: REQ_TYPE req_type REQUEST VTDEO_BRIDGE REQ_CODE req_code VTD_STOP_LOGGING CARD32 seq no CARD32 length CARD32 src ID CARD32 roomjid Reply-> None Error- > REPJTYPE rep_type ERRORJ7TDEOJ3RIDGE REP_CODE rep_code VTD_STOP_LOGGING CARD32 seqjao CARD32 length ERRjCODE err_code 5. Set_switch__params REQJTYPE req_type REQUEST VTDE0J3RIDGE REQ CODE req_code VID_SET 3WITCH_PARAMS CARD32 seqjao ~~ CARD32 length CARD32 src ID VID_SWITCH_PARAMS vid_sw Reply- > None Error-> REPJTYPE rep_type ERROR_VTDEO_BRIDGE REPJZODE rep_code VTD_SET_SWITCH_PARAMS CARD32 seqjao CARD32 length ERRjCODE err_code .H 2 "Protocol between Video Bridges" Requests: 1. Device_lnfo : REQJTYPE req_type REQUEST _VTDEO_BRIDGE REQ_CODE req_code VTDJDEVICE_INFO CARD32 seqjao ~~ CARD32 length Reply-> REPJTYPE rep_type REPLY VTDEOJ3RIDGE REP CODE rep_code VTDJDEVTCE_INFO CARD32 seq_no ~ " CARD32 length VTD_DEV_INFO vid_dev Error-> None 2. Send_Single: REQJTYPE req_type REQUEST VTDEOJ3RIDGE REQjCODE req_code VTD_SENDJ3INGLE CARD32 seqjao ~ " CARD32 length PARTICIPANT src Reply-> REQJTYPE req_type REPLY 7IDE0J3RIDGE REQjCODE req_ccde VTD_SEND_SINGLE CARD32 seqjno ~ CARD32 length VTD_SINGLE_INFO info Error-> REQjTYPE req_type ERRORJTTDEOJBRIDGE REQjCODE req__code VTD_SEND_SINGLE CARD32 seqjao CARD32 length ERRjCODE error 3. Send Composite : REQJTYPE req_type REQUESTJ7TDEOJ3RIDGE REQjCODE req_ccde VTD_SEND COMPOSITE CARD32 seqjno CARD32 length CARD32 list_length LJ?ARTICIPANT participant_list Reply-> REQJTYPE req type REPLY_VTDEO_BRIDGE REQjCODE req_ccde VTD_SENDJC0MPOSITE CARD32 seq_no CARD32 length VID_CC»α>OSITE_INFO info Error-> REQJTYPE req rype ERROR_VTDEO_BRIDGE REQjCODE req_code VTD_SEND_CQMPOSITE CARD32 seq_no ~ CARD32 length ERRjCODE error .H 1 "Events from Local Interface to Local Media Managers" 1. SuspendServer: EIEQJTYPE req_type EVENT CM REQ j CODE req_code MANj3USPEND_MANAGER CARD32 seq_no CARD32 length 2. ResumeServer : REQJTYPE req_type EVENT CM REQJCODE req_code . MAN_RESUME_MANAGER CARD32 seq_no CARD32 length 3. ConnectToBridge : REQJTYPE req_type EVENT CM REQJZODE req_code MAN_CONNECT_TO_.BRIDGE CARD32 seq_.no CARD32 length CARD32 roαm_id SERV_CONN server_connection 4. DisconnectFromBridge : EVENTjCM MANJDISCONNECT_FRCM_BRIDGE .H 1 "Events from Local Media Managers to Conversation Manager" 1. ManagerUp : REQJTYPE req_type EVENT_MAN REQJCODE req_code EVEJMANJUP CARD32 seq_no CARD32 length MEDIA media STRING udesc 2. StateChange : REQ TYPE req_type EVENT_MAN REQ CODE req_code EVE_STATE CHANGE CARD32 seq_.no "" CARD32 length CARD8 state // code: CONNECTION_NORMAL - 1, CONNECTIONJ3R0KEN = 0 .H 1 "Events from Conversation Manager to Local Media Managers" 1. Participantlnfo : REQJTYPE req_type EVENTjCM REQjCODE req_code EVE_PARTICIPANT_INFO CARD32 seqjao CARD32 length STRING participant_name PARTICIPANT participant_id .H 1 "Requests from Conversation Manager to VT" Reply-> REPJTYPE rep type REPLY_VT REP j CODE rep_code VT_MEETING_INVITATION CARD32 seqjao //0 - rejected, 1 - accepted Error- > REPJTYPE rep type ERR0RJ7T REPjCODE rep_code VI_MEETING_INVITATION CARD32 seq_no CARD32 length ERRjCODE err_ccde .H 1 "Events from CM to VT" 1. success ,H 1 "Events from VT to CM" VTUp : REQJTYPE req type EVENT_VT REQjCODE req_code EVE_VT_UP CARD32 seq_.no CARD32 length //length is zero CreateMeeting : REPJTYPE rep_type EVENTJVT REPjCODE rep_code EVE CREATE MEETING CARD32 se no //O = media absent, 1 = media included 2. CreatePersistentMeeting: REPJTYPE rep_type EVENT_VT REPjCODE rep_code EVE_CREATEJ?ERSISTENT_MEETING CARD32 seqjao CARD32 length CARD32 pseudojneetingjLd CARD32 participantjld CARD8 audio_flag //O = media absent, 1 - media included CARD8 video_flag CARD8 xwin_flag Protocol between Video Manager and Visual Interface : Events from Visual Interface to Local Video Manager 1. OpenDisplay : REPJTYPE repjtype EVENTJVT REP CODE rep_code EVE_OPEN_DISPLAY CARD32 seq_no CARD32 length 2. ViewParticipant : /******* don't know if needed, too similar to one next *****/ 2. ViewVideoSrc : REPJTYPE rep_type EVENTJVT REP CODE rep_ccde EVE_VIEW_VTDEO_SRC CARD32 seqjao CARD32 length CARD32 display_desc CARD32 room_id CARD32 vid CARD32 xpos // upper left hand corner CARD32 ypos CARD32 window size // 1 - full size, 2 - half size, 3 . ****★*******★***/ 3. ShareVideo : REPJTYPE rep type EVENT_VT REP CODE rep_code EVE 3HARE_VTDEO CARD32 seq_.no ~ " ~ CARD32 length CARD32 display_desc CARD32 roomjid CARD32 vid CARD32 xpos // upper left hand corner CARD32 ypos CARD32 windowjsize // 1 - full size, 2 - half size, 3 . 4. GetVideoId : REPJTYPE repjtype EVENTJVT REPjCODE rep_code EVE_GET_VTDEO_ID CARD32 seq_no ~ CARD32 length STRING description 5. SetVideoDisplayParams : REP TYPE rep type EVENTJVT REP CODE rep~COde EVE 3ET_VTDE0_DISPLAY_PARAMS CARD32 seq_no CARD32 length CARD32 displayjdesc CARD32 xpos // upper left hand corner CARD32 ypos CARD32 windowjsize // 1 - full size, 2 - half size, 3 . STRING chroma_key 6 CloseDisplay : REPJTYPE rep type EVENT_VT REPjCODE rep :ode EVENT_CLOSE_DISPLAY CARD32 seq_no CARD32 length CARD32 display_descriptor Protocol between Visual Interface and Video Manager: Events from Local Video Manager to Visual Interface DisplayDesclnfo REPJTYPE rep type EVENT_VTDEO_MGR REP_CODE rep~Cθde EVE_DISPLAY_DESC CARD32 seq_no CARD32 length CARD32 display descriptor GetVideoId : REP__TYPE rep_type EVENT VTDEO MGR REP_CODE rep_code EVE GET VTDEO ID CARD32 seqjao CARD32 length CARD32 video id // returned value VideoRequestFail : REPJTYPE rep_type EVENTJVTDEO_MGR REPjCODE rep_code EVE SHARE VTDEO CARD32 seqjao CARD32 length CARD32 roomjid CARD32 display_descriptor CARD32 filiure type /** shared_dev_in_use, devjaot_available, request preempted **/ SharedVideoInvite : REPJTYPE rep type EVENT_VTDEO_MGR REP CODE rep~code EVE_SHARED_VTDEO_INVITE CARD32 seq_.no CARD32 length CARD32 room id SharedVideoAccept : REPJTYPE rep_type EVENT_VTDEO_MGR REPjCODE rep_code EVE_SHAREDJVTDEO_ACCEPT CARD32 seq_no CARD32 length CARD32 roomjid CARD32 display_descriptor .tr . TL MR: A Multimedia Meeting Service (Appendices) .AU "J. Robert Ensor" J E HO 11353 2979 4F-607 vaxl35 » jre .AU "Murali Aravamudan" MA MH 51152 7396 7E-418 ulysses •mur .MT 0 .bP .HU "APPENDIX A" .DF PROTOCOL TYPE DEFINITIONS: BYTE: 8-bit value INT8: 8-bit signed integer INT16: 16-bit signed integer INT32: 32-bit signed integer CARD8: 8-bit unsigned integer CARD16: 16-bit unsigned integer CARD32: 32-bit unsigned integer REQJTYPE: CARD8 REQjCODE:- CARD8 ERRjCODE: CARD32 STRING: [CARD32, <item>] // length, actual string id length*CARD8 L_ROOM: ListOfCARD32 FULL_ROOM: [CARD32, STRING] // roomjid, room_name L_FULL_ROOM: ListOfFULL_R OM PARTICIPANT: CARD32 // ID Lj?ARTICIPANT: ListOfPARTICIPANT MEDIA: CARD8 // 0 - Audio, 1 - Phone, 2 - Video, 3 - XWindσws, // 4 - MSWindcws 5 - Mac 6 - C :wq L_MEDIA: ListOfMEDIA STATUS : CARD8 // 0-EMPTY_ROOM, l-ROCM_W_MEETING , 2-ROOM W RESOURCES, // 3-ROOM_W_MEETING_RESOURCES, 4-ROOMJW_SUSP___NDED_MEETING LOCKjsTATUS: CARD8 // 0-LOCKED, 1-UNLOCKED ROOM_ATTRIB: CARD32 MEETING_ATTRIB: CARD8 CONN_LIST: [STRING, CARD32] // <Machine, Port> PHONE_LIST: [STRING, STRING, STRING, STRING, STRING, STRING, STRING, STRING] which is [LocationCode, OutsideDialPrefix, InterexchangeCarrier AreaCode, Phone, InternalPhone, Country CountryCode] VTDEO_LIST : [CARD32 , CARD32, String, String, String, String, String, String, CARD32, CARD32, CARD32, CARD32] which is [vid, vid_dev_type, function , location j nach, locjnachjadd, control nach, control jnachjadd, control dev, switch_type, io_type, io number, pid] ~ L CONNECTIONS : ListOfCONNJUST L_NM_CONNECTIONS: ListOfCONN_LIST L ?HONE_CONNECTIONS : ListOfPHONE_LIST L_VTDEO_CONNECTIONS: ListOfVTDEOJ__IST NM_ADDR: <STRING, CARD32> RANGE_ID: <CARD32, CARD32> SERV CONNjTYPE: CARD8 // 0 for X like connections, 1 for Uninterpreted SERV_CONN: < STRING, CARD32> SERVER_DESC: [MEDIA, STRING, SERV CONN, STRING, STRING] LJ3ERVERS : ListOfSERVER_DESC MEDIA_SERV_INFO: [MEDIA, SERVjCONN] LJMEDIA_SERV_INFO: ListOfMEDIA_SERV_INFO MR_EVENTS : CARD32 // meeting_destroyed, server added etc. L_MR_EVENTS : ListOfMRj VENTS PART_SERV: [PARTICIPANT, MEDIA] L_PART_SERV: ListOfPARTjSERV .DE .bp - HU "APPENDIX B" .DF PROTOCOL MESSAGE HEADER STRUCTURE: Three classes of messages between Server-Client: (i) Requests (Client -> Server) (ii) Replies (Server -> Client) (iii) Events (Server -> Client) (iv) Errors (Server -> Client) Here 'Server' can be one of the following: MR Server, Registry Server, X Bridge, Video Bridge, and Audio Bridge. All packet lengths will be multiples of 4 bytes. The Header structure for any of these packets will be 10 bytes long. Header Structure of a Request Packet (the first 4 bytes): REQJTYPE req_type REQJCODE reσ_code CARD32 seq_no // sequence number for asynchronous protocol CARD32 length // X uses 18 bits for largest message The req_type indicates what type of request (request to a MR Server, request to a Registry server, request to a Media Server etc.). The req_ccde is the actual request opcode (e.g., create a room, show participant A, list rooms etc.). Since the protocols are asynchronous we need a sequence number so that a client can correlate replies/errors from the server with its requests. I Header Structure of a Reply/Event/Error Packet (the first 4 bytes): REPLYJTYPE rep type REPjCODE rep __cde CARD32 seqjao CARD32 length The repjtype indicates what type of reply (a proper reply from one of the servers, an event from one of the servers, an error from one of the servers). The rep_code is the actual reply/event/error. .DE client.h AWEHDΠ 2 client, h #ift»def CLIENT H ' # define __CLIENT_H 1 # define INIT_MAX_BUFLEN 65538 # include <NM_tjrpeβJι> # include <svstem_proto.h> # include < common _h> # include <List_h> # include <String.h> # include < Block _h> # include <pepp/pString.h> List_ f_pdeclare(Me3sageInfo) LtSt_θf_pdecl re Blockdeclare(ehar) Blockdeclare class Connection { public: C nneetion(MRInterfaee « if ace, MmConnection pconn); " Connection(); MmConnection conneetion { return(conn); } int sendlehar »data, int len); int sendlMessage *msg); int send MedServRequestClass •msg); Protocol »ProtoQ { return(Prot); } Convert »ConvQ_ { return(Iface— >ConvQ); } MRInterface »MRIface{) ( retupn(Iface); > int is aliveQ { retu_rn(aιive); } Room&gr »RoomManager { return(Ifaee— >RoomManager()); } void deactivate_self{) { ciie&t_dead(); } void reply or όuted_msg(Me3sage *msg, char • header, ehar *data, int data len); void serviced jnsg(Message *msg) { delete msg } ~ void send disconnect ); virtual void processjnsg() = 0; protected: void client j>rocess_msg(); void client_dead(); int alive; ~ MRInterface « If ace; Protocol «Prot; char headerfMSG HEADER LEN]; //static char heider[MSGJHEADERJLEN]; static int header len; ~ Block(ehar) buf; " //static Block(ehar) buf; MmConnection conn; } ; class SeqNoPair{ public: SeqNoPairfMessage «m, int orig_seq) : msg(m), orig seq_no(orig seq) {} ' Message *GetMsg { return msg; } ~ int GetOrigSeqO { return orig_seq_no; } private: Message «msg; int orig_seq_no; L-st_of_pdeclare(SeqNoPair) List_θf_pdeclare class ReqNM : public Connection { public: ReqNM (MRInterface »iface, MmConnection serv); int send request nsg(Mes3age «msg); client.h client. void process nsg(); ...Li t t_ f_ >deei private: int nm_seq_.no; L-3t_of_p(SeqNoPair) msgjiat; ! class LocalSession : public Connection { public: LocalSession (MRInterface • if ace, MmConnection pCIi); void process j nsgO; class FrontEnd : public Connection { public: FrontEnd(MRInterface *iface, MmConnection pCIi); void processjssg(); ; ! class ReqMR: public Connection { public: ReqMR(MRInterface « if ace, MmConnection serv); void processjnsgO; int send request nsgfMessage «msg) requestjnsg = msg; return(send(msg)); private: Message « requestjnsg; ! #endif co mon.b coznmon. # ifndef COMMON H # define _ ■ COMMOΓΓH l # include <sys/t)rpe-ϋ_> # include <syβ/timeJ_> # include <netdbJ_> //For struet hoβtent # include < s yyss//ssocket.h > //For AF INET # include <ce :// tnnne<*tinet/in.h> //For struct in addr # include <arpa/inet.n> //For inet_ntoa " //class Userlnterfaee; class MRInterface; class EventNotifier; class MRServerConnlnfo; class ServerRegistrjr; class MediaServerlnfo; class Protocol; class Connection; class LocalSession; class FrontEnd; class ReqMR; class ReqNM; class Room; class Meeting; class Conferee; class RoomMgr; class Convert; class Message; class MediaSerrer; class CommObjMgr; class MediaSerrerMgr; class LocalSessionMgr; class FrontEndMgr; class ReqMRMgr; class ReqNMMgr; struct Messagelnfo; # define HOST_NAME_LEN 1024 # include <Mm/MmNet orkMan.h> # include <Mm/MmEnum.h> # include < Mm/MmConnection.h > # include <NM ypes.h> ListdeclareTMmConnection) Listdeclare(String) I tβtdLeci istdecl # define NW (MmNet orkManager:NetworkManager()) #endif eve_niflg.Ii eve_msg. * _> #i ndef EVE MSG H # define __EVΕ_MSCΓH 1 # include <msg.h> class EveTemplatel: public EventClass { public: EveTemplatel(ehar • header, CARDS msg_typ, CARD8 msg_eode, int " msg_seq_no, int msg Jen, char « msg j iata, Connection *mvoker, ~ ~ List(MmConnection)& server ist, int src, int roomjd, int meeting d, int participant); /. class EveTemplate2: public EventClass { public: EveTemplate2(ehar • header, CARD8 sg yp, CARDS msg_code, int ~msg_seq_no, int msg len, char » msgjiata, Connection *mvoker, ~ List(MmConnection)& serrer_list, int src, int room j d); i class EveTemplate3: public EventClass { public: EveTemplate3(char • header, CARD8 msgjyp, CARD8 msg_eode, int msg_seq_no, int msg Jen, char •msg j iata, Connection «ιnvoker, ~ ~ List(MmConnect_on)& server_Iist, int src, int room id, int meeting id, List(int)£ plist); class EveTemplate4: public EventClass { public: EveTemplate4(ehar » header, CARD8 msgjyp, CARD8 msg ode, int * msg_seq_no, int msg Jen, char • msgjiata, Connection *ιnvoker, ~ List(MmConnection)& server list, int src, int roomjd, int meetingjdT Media med, String& user desc); } ; class EveTempiateδ: public EventClass { public: EveTemplate5(char * header, CARDS msgjyp, CARD8 msg_code, int ~msg_seq_no, int msg Jen, char « msgjiata, Connection *mvoker, — ~ List(MmConnection)& server ist, int src, int room id, int meeting id); } ; " class EveTemplateβ: public EventClass { public: EveTemplateβ(ehar • header, CARD8 msgjyp, CARD8 msg ∞de, int msg_seq_no, int msg Jen, char • msgjiata, Connection «tnvoker, ~ List(MmConnection)& server list, int src, int roomjd, int meetingj Media med, String& user desc, List(mt)& part ist); }; #endif event.h event.h #iftιdef MR EVENT H # define __ πr_EVENT_H 1 # include < common _h> class EventNotifier { public: EventNotifierfMRInterface * if ace); void ServerAdded(int src, int roomjd, int meeting id, Media med, String userjiesc, List(int & part_list); void ServerDropped(int src, int roomjd, int meetingjd, ~ Media med, String userjiesc); ~ void ServerAceessListSet(int src, int roomjd, int meetingjd, Media med, String userjiesc " , List(int)& partjist); private: void Templatel(CARD8 code, int roomjd, int src, int id, int participant); void Template2(CARD8 code, int roomjd, int src, int id); void Tempiate4(CARD8 code, int src, int roomjd, int meetingjd, Media med, String~user_ esc); ~ void Template5fCARD8 code, int src, int roomjd, int meetingjd); void Tempiateβ(CARD8 code, int src, int roomjd, int meeting~id, Media med, String- user desc, List(ϊht)& partjist); void server_eonn list(int roomjd, List(MmConnectionJ& conn_list); ~ void fend_eonn IIst(List(MmConnection)& conn_list); int next_seq_n<_ ) { return (++seq_no); } ~ int seq no; MRInterface * If ace; } ; #endi generator .h generator. #lfndef GENERATOR H # define ___GENERATOBf_H 1 # include <msg.h> #inelude <mr msg-h> # include <me3serr_msg.h> /• The following function* -will create a message object Note that only message* that are received bf the MR Server will have en equivalent function (Requests, Events and Replies generated bf the MR Server have aβ relation to this set of functions. » / class ProtoGenerator { public: static Message default_generator(ehar *, CARD8, CARD8, CARD32, CARD32, char » , Connection *); static Message *Gen CreateRoom(char a, CARD8, CARD8, CARD32, CARD32, char ■* , Connection • static Message aGen~DestroyRoom(ehar » , CARD8, CARD8, CARD32, CARD32, char «, Connection static Message •Gen~ListRooms(ehar «, CARDS, CARD8, CARD32, CAKD32, char • , Connection *); static Message aGen~Sho RoomStatus(char *, CARD8, CARD8, CARD32, CARD32, ehar «, Connecti static Message aGen~ShowRoomAttributes ( char a, CARD8, CARD8, CARD32, CARD32, char a, Con static Message • Gen~AlterRoomAttributes(char •, CARD8, CARD8, CARD32, CARD32, char «, Conn static Message aGen~LockRoom(ehar a, CARD8, CARD8, CARD32, CARD32, char a, Connection •); static Message *Gen~XJnlockRoom(char a, CARD8, CARD8, CARD32, CARD32, ehar ■», Connection a static Message aGen-Shσ AssoeiatedRoom(ehar a , CARD8, CARD8, CARD32, CARD32, char a, Con static Message aGen_ShowAssociatedMeeting(ehar a, CARD8, CARD8, CARD32; CARD32, char a, C static Message aGen CreateMeeting(char a, CARD8, CARD8, CARD32, CARD32, ehar » , Connection static Message aGen~DestroyMeetin (ehar a , CARD8, CARD8, CARD32, CARD32, ehar a, Connectio static Message aGen1_istMeetings(ehar a, CARD8, CARD8, CARD32, CARD32, char a , Connection • static Message βGen~ShowMeetingStatus(ehar a, CARD8, CARD8, CARD32, CARD32, char », Conne static Message aGen~Sho MeetRoomStatus(ehar •, CARD8, CARD8, CARD32, CARD32, ehar *, Co static Message aGen~ShowMeetingAttributes(char a, CARD8, CARDS, CARD32, CARD32, ehar * , C static Message •Gen_AlterMeetingAttributes(char a, CARD8, CARD8, CARD32, CARD32, char «, C static Message aGen AddParticipant(ehar * , CARD8, CARD8, CARD32, CARD32, char •, Connectio static Message aGen~DropParticipant(ehar «, CARD8, CARD8, CARD32, CARD32, ehar * , Connecti static Message •Gen~LeaveMeeting(ehar a, CARD8, CARD8, CARD32, CARD32, char a, Connection static Message aGen~ReenterMeeting(ehar », CARD8, CARD8, CARD32, CARD32, char * , Connectio static Message •Gen~SuspendMeeting(ehar «, CARD8, CARD8, CARD32, CARD32, char * , Connecti static Message «GenTtesumeMeeting(ehar « , CARD8, CARD8, CARD32, CARD32, char « , Connectio static Message *Gen AddServer(ehar » , CARD8, CARD8, CARD32, CARD32. char « , Connection *): static Message «Gen~DropServer(ehar «, CARD8, CARD8, CARD32, CARD32, char «, Connection «) static Message •Gen-SetServerAeeessList(char « , CARD8, CARD8, CARD32, CARD32, ehar * , Conn static Message aGen~ " ListServen(ehar a, CARD8, CARD8, CARD32, CARD32, char •, Connection *) static Message •Gen~GetServerInfo(<_har a, CARD8, CARD8, CARD32, CARD32, ehar *, Connection static Message aGen-SuspendServer(char a, CARD8, CARD8, CARD32, CARD32, char » , Connectio static Message • Gen ResumeServer( char a, CARD8, CARD8, CARD32, CARD32, char a , Connection static Message aGen NameSerrerMsg(ehar * , CARD8, CARD8, CARD32, CARD32, ehar » , Connecti static Message •Gen ' CreateUserichar « , CARD8, CARD8, CARD32, CARD32, ehar *, Connection *) static Message •Gen~CreateDup lser(ehar • , CARD8, CARD8, CARD32, CARD32, char •, Connectio static Message »Gen~DeleteUser(ehar « , CARD8, CARD8, CARD32, CARD32, char », Connection a) static Message Gen~GetPeπonlnfo(ehar a, CARD8, CARD8, CARD32, CARD32, ehar a, Connectio static Message aGen~CreateNMEntry(ehar « , CARD8, CARD8, CARD32, CARD32, ehar * , Connecti static Message aGen~DeleteNMEntry(ehar • , CARD8, CARD8, CARD32. CARD32, char a , Connecti static Message aGen~GetNMEntry(char • , CARD8, CARD8, CARD32, CARD32, ehar a , Connection static Message »Gen_Disconnect(ehar « , CARD8, CARD8, CARD32, CARD32, ehar «, Connection • }; generator.h generator .n #endif iface ' h iface. #if ι<kf IFACE H # define " -FACETH l # include < common Jι> # include <proto.h> # include <msg.h> # include <mr msg.h> # include <me3serv_msg.h> # include <ports.h> " # include <iostream.h> # include <fstream.h> # include < eon vert. h> List_of_pdeclare(CommObjMgr) List_θf p declar void shutdo n(); class MRInterface { public: ' MRInterface{) {}; "MRInterface(); void startup(ιnt arge, ehar «argvQ); RoomMgr *Rooπ_Manager() { return(RMgr); } MediaServerMgr •MediaServerManager() { return(MSMgr); } ReqMRMgr aReqMRMaaagerQ { return(MRMgr); } ReqNMMgr •ReqNMManagerQ { return(NMMgr); } EventNotifier •EveNotifier { return(EveNot); } FrontEndMgr «FEManager() { return FE_Mgr); } Protocol aProtoO { returnfProt); } Convert aConv(} { return/ Con vMethods): } SenrerRegisti aSerrRefrf) ( return(SReg); } Connection "Persist en tConnection() { return(PersConn); } private: // Connection and Coordination void mainJoopQ; void garbage_collect(); List of p(CommObjMgr) objectjist; Protocol aProt; Convert aConvMethods; RoomMgr aRMgr; EventNotifier aEveNot; ServerRegistry SReg; MediaServerMgr «MSMgr; ReqNMMgr «NMMgr; ReqMRMgr «MRMgr LocalSessionMgr «LSMgr; FrontEndMgr aFEMgr; Connection •PersConn; int FE_port; } ; #endif med_serv.h me serv.h # inelude <obj_man_h> List_of ρdeclare MediaServer) ist of odecL L-3t_o >deelare(MedSenrRequestClass) LXSt~ 'of paecli are are class MediaServer : public Connection { public: MediaServer(MRInterfaee « if ace, MmConnection serv, int medjd, int room, MediaServerlnfo a info); void processjnsgO; ~ int Serverld() f returned); } Media medium() { return(Medium); } String user_desc() { return(UserDesc); } int get er er onnection(M∞iaServerConn& info) ~ - { info — connjnfo; return 0; } void setjnanagerjport(int port { mgr conn~info.port = port; } int get_manager_conneetion(MeαiaServerConn£ info) ~ ~ { info = mgr onn info; return 0; } int send equestjnsgfMedServKequestClass a~medserv msg); " MediaServerO; ~ ~~ private: int id; MediaServerConn conn_info; MediaServerConn mgr j»nn_info; Media Medium; ~ " String UserDesc; List_of_p(MedServRequestClass) msgjist; / » class MediaServerMgr : public CommObjMgr { public: MediaServerMgi MRInterface a if ace) : CommObjMgr(if ee) { is_alive = 1; next_server id — 0; gen seq_no = 0; } " MediaServerMgr ; ~ ~ ~ void proeess(MmConnection serv); int get_serverjnfo(int server, Media_& m, String& user j iesc); int get_seπrer_connection(Media m, String& user j iesc, " ~ - MediaServerConn& conn); int getjnanager_connection(Media m, String& userjiesc, ~ ~ ~ MediaServerConn^ conn); void setjnanager ort(Media m, String& userjiesc, int port); MmConnection ServerConnection(int server); " int get_server jd(Media m, S ring& userjiesc); void send(int~m, ehar *data, int len); ~ void sendjo all_servers(ehar a data, int len); int AddServάRRequestClass amsg, CARD32 requester, int roomjd, Media media, String& user j iesc, List(int)& partjist); ~ int DropServer RequestClass •msg, _ CARD32 requester, int roomjd, Media media, String& user j iesc); ~ void DropServerfint room id, int " server id); int SuspendServer(RequesiC ass amsg, CXRD32 requester, int roomjd, Media media, String& user j iesc); ~ int ResumeServe RequestClass •msg, CARD32 requester, int roomjd, Media media, String& user j iesc); ~ int SetServerAceessList(RequestCla_u «msg, CARD32 requester, int roomjd, Media media, String& user_desc, List(int)& part_list); ~ private: void garbage_collect(); int init media_server(RequestClass *stimulant, int room, Media m, ~ String user desc, List(int) part list); med_ β erv.h me jserv. MediaServera get_media_server(Media m, String user desc); _._* of β d t cla MediaServera get media servenint server id); ~ ~ Int ne_rt_seq_no() { retuπι(-»-+gen_se no); } medserv_m8g.h medserv_msg. #i_fedef MEDSERV MSG H # define ffiDSERV_MSGTH 1 # inelude <msg.h> # include <ioβtream_h> class REP_AddServer : public ReplyClass { public: - REP_AddServer(ehar a header, CARD8 msgjyp, CARD8 msg code, int msg seq_no, int msg len, ehar amsg data, Connection ainvoker): ~ ReplyClaβs(header, msgjyp, msg_eodeTmsg seq_no, msg len, msg data, Invoker) ) msg obj_states action() {return(e_M5G SERVICED);} void " r_action(MediaServerConn& cionn);- > class AddServer : public RequestClass { public: AddServer(ehar "header, CARD8 msg typ, CARD8 msg eode, int msg seq no, int msg Jen, efiar amsg data, Connection ainvdEerjT RequestClass(header, msgjyp, msg_cό e,msg_seq_no, msg Jen, msgjiata, invoker) {}- msg_obj_states action(); ~ / ! class DropServer: public RequestClass { public: DropServer(ehar a header, CARD8 msgjyp, CARD8 msg j eode, int msg seq_no, int msg Jen, ehar amsg data, Connection ainvoEer): RequestClaasfheader, msg typ, msg co3e,msg seq_no, msgjen, msgjiata, invoker) {} " " msg_obj_staies action(); - ~ class SetServerAccessList: public RequestClass { public: SetServerAccessList(char • header, CARD8 msgjyp, CARD8 msg_code, int msg_seq_no, int msgjen, ehar • msg " data, Connection~*invoker): ~ RequestClass(header, msgjyp, msg_co3e,msg_seq_no, msgjen, msgjiata, in oker) {} " msg_obj_states action(); ~ class REP_ListServers: public ReplyClass { public: ~ REP_ListServers(ehar • header, CARD8 msgjyp, CARD8 msgjode, int msg_seq_no, ~ int msgjen, ehar » msgjiata, Connection •invoker): ~ ReplyClass(header, msgjyp, msgjodeTmsg seq_no, msg len, msg data, nvoker) ) msg obj states action() {returnee M5G_SERVICED);} void " r_acticβ(L_st_c^_p(FulIMed_aI5e3c)<fe medjist); class ListServers: public RequestClass { public: ListServers(ehar a header, CARD8 msgjyp, CARD8 msg_code, int msg seq_no, int msgjen, char amsg data, Connection ainvoEer): RequestClass(header, msgjyp, msg_co3e,ms _seq_no, msgjen, msg j iata, invoker) {} " msg obj states aetion(); ~ ~ }; " " class REP_GetServerInfo: public ReplyClass { public: " REP GetServerInfo(char aheader, CARD8 msg_typ, CARD8 msg_eode, int msg_seq_.no, ~ int msgjen, ehar • msgjiata, Connection • invoker): ReplyCla3s(header, msgjyp, msg_code7msg_seq_no, medserv_msg.h medserv_msg. msg len, msg data, invoker) {} msg objj-tates action() {returnee MSG SERVICED);} void " r_actioo(MediaServerConn& c nn);- class GetServerlnfo: public RequestClass { public: GetServerInfo(ehar aheader, CARD8 msgjyp, CARD8 msg code, int msg seq_no, int msgjen, ehar~amsg data, Connection ainvokerj: RequestClass(header, msgjyp, msg cdae,msg seq j io, msg len, msg data, invoker) { msg_obj_states action(); ~ I t class SuspendServer: public RequestClass { public: SuspendServer(ehar aheader, CARD8 msgjyp, CARD8 msg code, int msg seq_no, int msgjen, ehar " amsg data, Connection * invoker) RequestClass(header, msgjyp, msg_coαe,ms seq_no, msgjen, msgjiata, invoker) {} "" msg_obj_states aetion(); ~ ~ J * t class ResumeServer: public RequestClass { public: ResumeServer(ehar aheader, CARD8 msgjyp, CARD8 msg ode, int msg seq_no, int msgjen, ehar~amsg data, Connection • invoker J: RequestClass(header, msgjyp, msg_eo3e,msg seq_no, msgjen, msgjiata, invoker) { msg_obj_states action(); "" ~ /» l ///JU ReIpIJlyII aInIdUL EIrroIIrII mIIeIsIsaIgIeIsII f/rollmlll Glelnlelrlicll/ MIeIdUiaII ////////////////////////////////////////////////////////////////////// class AssociateServer: public MedServRequestClass{ public: AssociateServer(RequestClass astimulant, ehar header, CARD8 msg typ, CARD8 msg j eode, int msgjseq no, ~ int msgjen,- ehar amsg data, Connection a invoker, int proόm, List(int)& pfist, Media pmedia, String& puser_desc); void specia__action(Block(ehar)& reply j iata, int rdatajen); private: List(int) partjist; class DisassociateServer: public MedSeπrRequestClass{ public: DisassociateSerrerfRequestClass astimulant, ehar aheader, CARD8 msgjyp, CARD8 msgjode, int msgjseq no, - int msg Jen, " ehar » msgjiata, Connection • invoker, int proόm, Media pmedia, String& puserjiese); void special_action(Block(ehar)& reply jiata, int rdatajen); ~ > 'ι class GenSuspendServer public MedServRequestClass{ public: GenSuspendServer(RequestCIass astimulant, char aheader, CARD8 msgjyp, CARDS msg_code, int msgjseq no, - int ms jen,- char a msgjiata, Connection • invoker, int proόm, Media pmedia, String& puserjiese); void special action(Block(ehar)& reply jiata, int rdata len); ~ } ; class GenResumeServer: public MedServRequestClass{ medserv_msg.h medserv_msg. public: GenResαmeSenrerfRequestClaβs astimulant, ehar aheader, CARD8 msg typ, CARD8 msg_code, int msg_seq no, " * int msgjen,- ehar amsg data, Connection a invoker, int roόm, Media pmedia, String& puser desc); void speeia__action(Block(enar)<S_ reply jiata, int rdatajen); ~ class SetAceessList: public MedServRequestClass{ public: SetAecessList(RequestClass astimulant, ehar aheader, CARD8 msg typ, CARD8 msg code, int msg seq no, ~ int msgjen char amsg data, Connection • invoker, int proόm, List int)& pGst, Media pmedia, String& puser_desc); void special_action(Block(ehar)& reply_data, int rdatajen); private: List(int) part_list; J i #endif mr_msg.h mr_msg.a # l nde MR MSG H # define ~MH~MSG_H 1 # include <msg.h> class Disconnect: public RequestClass { public: Diseonneet(ehar aheader, CARD8 msgjyp, CARDS msg j eode, int msg seq_no, int msgjen, cnar *msg data, Connection *invoEer): RequestClass(header, msgjyp, msg coαe.msg seq_no, msgjen, msgjiata, invoker) {} " msg_obj_states action(); ~ - ! class REP_CreateRoom : public ReplyClass { public: ~ REP_CreateRoom(ehar aheader, CARD8 msgjyp, CARD8 msg code, int msg seq_no, ~ int msgjen, ehar βmsg iata, Connection • invoker): ~ ReplyClass(header, msgjyp, ms jodeTmsg seq j io, msgjen, msg_data, nvoker) J) void r action(int id); - ~ msg_ob7_states action() {return(e_MSG_SERVICED); } I t class CreateRoom : public MRMRRequestClass { public: CreateRoom(ehar aheader, CARD8 msgjyp, CARD8 msg code, int msg seq_.no, int msgjen, char a msgjiata, Connection a invoker): MRMRRequestClassfheader, msgjyp, " msg code,msg seq_no, msgjen, msgjiata,- invoker) ^} ~ msg_obj_states action(); - - private: REP_CreateRoom « reply; class DestroyRoom : public MRMRRequestClass { public: DestroyRoom(ehar aheader, CARD8 msgjyp, CARD8 msg_code, int msg seq_no, int msgjen, char « msgjiata, Connection • invoker): MRMRRequestClaβs(header, msgjyp, msg code,msg_seq_no, msgjen, msg jiata,- invoker) ~ } ~ msg obj states action(); - - class REP_ListRooms : public ReplyClass { public: ~ REP_L tRooma(ehar aheader, CARD8 msgjyp, CARD8 msg_eode, int msg_seq_no, ~ int msgjen, ehar * " ms jiata, Connection a invoker): ~ ReplyClass(header, msgjyp, msgjodeTmsg seq_no, msg len, msg data. " Invoker) Q msg obj states actionQ {return(e_MSG SERVICED);} void " r action(List(int)« room list7 List(String)& name list); } ; class ListRooms : public MRMRRequestClass { public: ListRooms(ehar aheader, CARD8 msg typ, CARD8 msg_code, int msg se no, int msgjen, cEar «_nsg_data, Connection •involer): MRMRRequestClass(header, msgjyp, msg code,msg_seq_no, msgjen , msg_datar invoker) ~{ } msg_obj_states action(); ~ private: REPJJstRooms reply; I ' t class REP_ShowRoomStatU3 : public ReplyClass { public: — REP_ShowRoomStatus(ehar aheader, CARD8 msgjyp, CARD8 msg code, int msg seq_no, int msgjen, ehar •msg dsta, Connection ainvoker): ReplyClaβs(header, msg typ, msg code,msg seq_no, msg len, msg data, nvoker) {"} m objjstates action() {retum(e_M5GjSERVICED);} void * r_action(RoomStatU8 stat, KoomLόckStatus lock_stat); J ϊ class Sho RoomStatus : public MRMRRequestClass { public: ShowRoomStatus(ehar aheader, CARD8 msgjyp, CARD8 msg code, int msg seq j no, int msgjen, ehar « msgjiata, Connection • invoker): ~ MRMRRequestClass(header, msgjyp, " msg code,msg seq_no, msgjen, msgjiata,- invoker) ~\} " msg obj states action(); - - private: REP_ShowRoomStatus a reply; class REP_Shσ RoomAttributes: public ReplyClass { public: ~ REP_Sho RoomAttributes(ehar aheader, CARD8 msg typ, CARD8 msg code, int msg seq_no, "* int msgjen, ehar amsg data, " Connection •invoker): ~ ReplyClaas(header, msgjyp, msgjodeTmsg seq_no, msg len, msg data, " Invoker) X) msg obj_states action() fretu_rn(e_MSG_SERVICE--));} void " r_action(RoomAttrio attrib);- ~ ! class Sho RoomAttributes: public MRMRRequestClass { public: ShowRoomΛttributes(char aheader, CARD8 msg typ, CARD8 msg_eode, int msg_seq_no, int msgjen, ehar • msgjiata, Connection alnvoker): ~ MRMRRequestClass(header, msgjyp, " msg code,msg_seq_no, msgjen, msg jiata, " invoker) " ^} "* msg j objjstates action(); ~ - private: REP ShowRoomAttributes a reply; }; class AlterRoomAttributes: public ' MRMRRequestClass { public: AlterRoomAttributes(ehar aheader, CARD8 msg typ, CARD8 msg_eode, int msg eq_no, int msgjen, ehar a msgjiata, Connection Tinvoker): ~ MRMRRequestClass(neader, msgjyp, " msg code,msg_seq_no, msgjen, msgjiata,- invoker) " {} - msg j obj j states aetion(); - ~ i t class LockRoom : public MRMRRequestClass { public: LockRoom(ehar aheader, CARD8 msg typ, CARD8 sg ode, int msg seq .no, int msg len, c ar « msg j iata, Connection ainvoEer): MRMRRequestClass header, msgjyp, " msg code,msg_seq_no, msgjen, msg_data,~ invoker) ~ } msg obj states action(); ~ } ; " " class UnlockRoom : public MRMRRequestClass { mr_msg.h mr_msg.h public: UnlockRoom(ehar aheader, CARD8 msgjyp, CARD8 msg code, int msg seq_no, t M _- " iat BI|β lβn » ***** «m β g_data, Connection ainvoker): MRMRRequestClaas(header, msg typ, msg code,msg seq uo, msgjen, msg_data,- invoker) ~D msg_obj_statea aet >n(); ~ I t class REP_ShowAssociatedRoom : public ReplyClass { public: ~ REP_ShowAs β ociatedRoom(ehar aheader, CARD8 msg typ, CARD8 msg code, int msg seq_no, int msgjen, ehar amsg data, " Connection • invoker): ~ Rep_yClass(header, msgjyp, msgjodeTmsg seq_no, msg len, msg data, Invoker) J) msg objjstates action() {retαrn(e_M5G SERVICED);} void " r Jaetion(int roomjd); - - I t class ShowAssocistedRoom : public MRMRRequestClass { public: ShowAssociatedRoom(ehar • header, CARD8 msg typ, CARD8 msg code, int msg seq_no, int msgjen, char « msgjiata. Connection ainvoker): ~ MRMRRequestClass(header, msgjyp, " msg code,msg seq_no, msgjen, msgjiata, invoker) ~\} ~ msg_obj_states action(); ~ — private: REPjShowAssociatedRoom a reply; / > class REPjShøwAssociatedMeeting: public ReplyClass { public: - REP_Sho A__βociatedMeetmg(char aheader, CARD8 msgjyp, CARD8 msg code, int msg seq_no, ~ int msgjen, ehar a msgjiata, Connection invokerj: - ReplyClass(header, msgjyp, msgjodeTmsg seq_no, msg len, msg data, " Invoker) X} msg obj tates action() {return(e_M5G_SERVICED);} void " r_act_on(int meetingjd); - - class ShowAssociatedMeeting : public MRMRRequestClass { public: ShowAssociatedMeeting^ehar aheader, CARD8 msgjyp, CARD8 msg_eode, int msg_seq_no, int msgjen, ehar « msgjiata. Connection ainvoker): ~ MRMRRequestClass(neader, msgjyp, msg code,msg_seq_no, msgjen, msg jiata,- invoker) "" {} " msg_obj_states action(); - " private: REP ShowAssociatedMeeting a reply; } ; class REP_CreateMeeting : public ReplyClass { public: REP CreateMeeting(ehar aheader, CARD8 msgjyp, CARD8 msg ode, int msg_seq_no, ~ int msg len, ehar •msgjiata, Connection " ainvoker): ~ ReplyClaβ8(header, msgjyp, msg ode,msg seqjio, msg len, msg data, " Invoker) X) msg obj j states action() {i«tt i(e_MSG_SERVICED);} void " r_action(int id); - " class CreateMeeting : public MRMRRequestClass { public: CreateMeeting(d_u_r aheader, CARD8 msgjyp, CARD8 msgjode, int msg seqjio, int msg len, ehar " « msgjiata, Connection •invoker): MRMRRequestClass(h?ader, msgjyp, " _nsg_code,msg_seq_no, mr_msg.h mr_msg.h msg len, msg data, invoker) {} msg obj states action(); " private: REP_CreateMeeting * reply; class DestroyMeeting : public MRMRRequestClass { public: DestroyMeeting(ehar "header, CARD8 msg_typ, CARD8 msg code, int msg seq_no, . _ ™ _ _-. "£. ∞β β0 . β * a msgjiata, Connection ainvoker): " MRMRRequestClaas(header, msg typ, msg code,msg seq_no, msgjen, s d t r invoker) " {} msg_obj_states action(); ~ I • class REP_ListMeetings : public ReplyClass { public: — R£P_ListMeetings(ehar aheader, CARD8 msgjyp, CARD8 msg code, int msg se no, " int msgjen, ehar amsg data, Connection ainvoker): " ReplyClass(header, msgjyp, msg_eode7msg seqjao, msg len, msg data. nvoker) X) msg objjstates action {return(e MSG_SERVICED);} void r_action(L-3t(int)& meetingj st); J i class ListMeetings : public MRMRRequestClass { public: ListMeetings(ehar aheader, CARD8 msgjyp, CARD8 msg j eode,- int msg seq_no, int 'msgjen, char » msgjiata. Connection *invoker): MRMRReque3tClass(neader, msgjyp, " sg code.msg seq_no, msgjen, msg_dataT invoker) " {} - msg_obj_states action(); - " private: REP ListMeetings • reply; } ; class REP_ShowMeetingStatus : public ReplyClass { public: " REP_ShowMeetingStatus(ehar aheader, CARD8 msgjyp, CARD8 msg code, int msg seq_no, " int msgjen, char amsg_data7 Connection ainvoker): " Rep.yCla__s(header, msgjyp, msg odeTmsg seq_no, msg len, msg data, nvoker) X) msg obj_states action( .) { . re-turn( , e M . .SG_SERV IICCED) ,;.}. void " r_action(List(Part_cιpantI_-io)£ infόi int roomjd, ~ int owner, MeetingStatus status); }; class ShowMeetingStatus : public MRMRRequestClass { public: ShowMeetingStatus(ehar aheader, CARD8 msgjyp, CARD8 msg j eode, int msg_seq_no, int msgjen, ehar «π_sg_data, Connection- ainvoker): ~ MRMRRequestClass(header, msgjyp, msg code,msg_seq_no, msgjen, msg_dataT invoker) ~\ } msg_obj_states action(); - ~ private: REP ShowMeetingStatus areply; } ; class EEP_ShowMeetRoomStatus : public ReplyClass { public: ~ REP ShowMeetRoomStatus(ehar aheader, CARD8 msg typ, CARDS msgjode, int msg_seq_no, " int msgjen, char • msg j iata. Connection ainvoker): ReplyClass(header, msgjyp, msgjrαdeTmsg seq_no, msgjen, msg data, Invoker) X) msg obj states action() {return(e MSG SERVICED);} mr_msg.h mr_msg.h void r_acύon(L_st(ParticipantInfo)<fe info, int meeting id, ~ int owner, MeetingStatus status); / ! class Shσ MeetRoomStatus : public MRMRRequestClass { public: ShowMeetRoomStatus(ehar aheader, CARD8 msg typ, CARD8 msg code, int msg seq_no, « _- » _-_ *. *"-! . ™β en ' *&** « π_3gjfata, Connection ainvoker): MRMRRequestClass(header, msg typ, msg code, msg seq_no, msgjen, msg data,- invoker) ~\} ~ msg obj tates action(); - " private: REP_ShowMeetRoomStatus a reply; I class REP_ShowMeetingAttributes: public ReplyClass { public: - REP_ShowMeetingAttributes(ehar aheader, CARD8 msgjyp, CARD8 msg code, int msg seq_no, int msgjen, char amsg data, Connection ainvokerj: ReplyClass(header, msgjyp, msg code7msg seq_no, msg len, msg data, " Invoker) X) msg objjstates action() {return(e M5G_SERVICED);} void " r_action(MeetingAttrib attri-7); ~ ! class ShowMeetingAttributes: public MRMRRequestClass { public: private: REP_ShowMeetingAttributes a reply; I t class AlterMeetingAttributes: public MRMRRequestClass { public: AlterMeetingAttributes(ehar * header, CARD8 msgjyp, CARD8 msg j ode, int msg_seq_no, int msgjen, char « msgjiata, Connection * invoker): ~ MRMRRequestClass(neader, msgjyp, " msg code,msg eq_no, msgjen, msg_dataT invoker) ~~{} ~ msg obj states action(); ~ } ; " ' class AddParticipant : public MRMRRequestClass { public: AddParticipant (ehar aheader, CARD8 msgjyp, CARDS msgjode, int msg_seq_no, int msgjen, char » sgjiata, Connection ainvoker): " MRMRRequestClass(header, msgjyp, " msg code,msg seq_no, msgjen, msg_datar invoker) ~{} ~ " msg ϊbj states action(); - ~ ) 't class DropParticipant: public MRMRRequestClass { public: DropParticipant(ehar aheader, CARD8 msgjyp, CARD8 msg rode, int msg_seq_no, int msgjen, ehar • msgjiata, Connection ainvoker): ~ MRMRRequestClass(header, msgjyp, msg code,msg .eq_no, msgjen, msg_data,~ invoker) ~\ } - msg obj states action(); ~ ~ }; " " class LeaveMeeting: public MRMRRequestClass { public: LeaveMeeting(char • header, CARD8 msgjyp, CARD8 msgjode, int msg_seq_no, mr_msg.h mr_msg.h , - « _-, τ , **£ m ~?J' i -~' e a •msgjiata, Connection ainvoker): MRMRReqαestClaaa(header, msg typ, msg code.msg seq_no, msg len, msg data, invoker)"^} - msg_obj_stat*β action(); ~ /» class ReenterMeeting: public MRMRRequestClass { public: ReenterMeeting(ehar aheader, CARD8 msgjyp, CARD8 msg code, int msg seq_no, , m , mn '"£ ""fβj β , ehar «~msg_data, Connection invoker): " MRMRRequestClass(header, msgjyp, msg code.msg se no, msgjen, msg dataT invoker) 1} ~ msg obj states * et * on (); ~ ~ class SuspendMeeting: public MRMRRequestClass { public: SuspendMeeting(ehar aheader, CARD8 msgjyp, CARD8 msg code, int msg seq_no, int msgjen, ehar amsg data, Connection ainvoker): ~ MRMRRequestClass(neader, msgjyp, msg code.msg seqjio, msgjen, msgjiata, " invoker) ~ } ~ msgj>bj_states action(); ~ ~ > i class ResumeMeeting: public MRMRRequestClass { public: ResumeMeeting(ehar aheader, CARD8 msgjyp, CARD8 msg code, int msg seq_no, int msgjen, ehar amsg data, Connection ainvoker):" MRMRRequestClaas(header, msgjyp, " msg code.msg seq_no, msgjen, msg_dataT invoker) ~{} " msg_obj_states action(); ~ ~ /> // Name Server Messages ' class CreateUser: public RequestClass { public: CreateUser(ehar aheader, CARD8 msgjyp, CARD8 msgjode, int msg seq_no, int msgjen, char amsg data, Connection •invoEer): RequestClass(header, msgjyp, msg_cd3e,ms _seq_no, msg len, msg data, invoker) { msgjbj tates action() { rieturn(e_MSG_SERVICED); } class CreateDupUser: public RequestClass { public: CreateDupUser(ehar •header, CARD8 msgjyp, CARD8 msg j ode, int π_3g_seq_no, int msgjen, ehar • ' msg data, Connection « invoker):- RequestClaas(header, msgjyp, msg ό3e,msg_seq_no, msg len, msg data, invoker) {} " msg_obj tates action() { return(e_MSG_SERVICED); } class DeleteUser: public RequestClass { public: DeleteUser(ehar aheader, CARD8 msg typ, CARD8 msgjode, int msg seqjto, int. msgjen, cSar *msg data, Connection *invόEer): RequestClass(header, msgjyp, msg_co3e,msg_ seqjao, msg len, msg data, invoker) (}~ msg obj states action() { return(e ΛSG SERλ CED); } }; " ~ class GetPersonlnfo: public RequestClass { public: GetPereonInfo(ehar aheader, CARD8 msgjyp, CARD8 msgjode, int msg seq no, int msgjen, char-* msg data, Connection •invoker): RequestClass(header, msgjyp, msg_cόαe,msg_seq_no, msgjen, msgjiata, invoker) {} mr_msg.h mr_msg.h msg obj tates actiόn() { retum(e_MSG_SERVICED); } I t class CreateNMEntry: public RequestClass { public: CreateNMEntry(ehar aheader, CARD8 msgjyp, CARD8 msg code, int msg seq_no, int msgjen, ehar β" msg data, Connection invoker): ~ RequestClass(header, msgjyp, msg_cόde,msg seq_no, msg len, msg data, invoker) {} " msgj>bj_states action() { eturn(eJ GJ5ERVICED); } class DeleteNMEntry: public RequestClass { public: DeleteNMEntry(char aheader, CARD8 msgjyp, CARD8 msg code, int msg seq_no, int msgjen, ehar amsg data, Connection ainvoker):" RequestC1ass(header, msgjyp, msg cό3e,msg seq_no, msg len, msg data, invoker) {} " msg_obj tates action() { feturn(e_MSG_SERVICED); } J i class GetNMEntry: public RequestClass { public: GetNMEntry(ehar aheader, CARD8 msgjyp, CARD8 msg code, int msg seq_no, int msgjen, ehar 7 amsg data, Connection ainvoker): RequestClass(beader, msgjyp, msg_cόSe,msg seq_no, msg len, msg data, invoker) {} " msg j objjtates action() { Λturn(e_MSG_SERVICED); } f t class NameServerMsg: public RequestClass { public: NameServerMsg(ehar aheader, CARD8 msgjyp, CARD8 msgjode, int msg_seq_no, int msgjen, ehar «π_sg data, Connection « invoker): ~ RequestClass(header, msgjyp, msgjode , msg seq_no, msgjen, msgjiata, invoker) {} " msg_obj_states action(); / > #endi ^ msg.h #ιft»def MSG H #c « . TJMS ΓΉ 1 # include <NM types.h> # include <sysMm_protoJι> # include < common Jι> # include <Ust_h> # include <BloekJι> # include < event.h > # define INIT_MAX_REPLYSIZE 8192 Blockdeclare(ehar) Blockdedare enum msgjobjjtates { e MSG IN SERVICE, e MSG READY, e_MSG_PENDING, e_MSG_SERVICED }; class Message { public: - Message{ehar am header, CARD8 msgjyp, CARD8 msgjode, int msg eq no, int msgjen,- ehar a msgjiata, Connection ainvoker); CARD8 msgjypeQ f return type; } CARD8 msg~code() { return opcode; } int msg seq " no() { return seq_no; } int msgjen { return len; } ehar msg data() { return data; } ehar amsgjicader f return header; } void setjή_κ seq no(ιnt s); Connection a sgSόαree() { return Invoker } int for NameSerrerO; int for omβ other_MR(int MRjd); virtual " msg ό j states action() = 0; protected: int len jn_CARD32(int len _in_bytes); List of pdeelare(Meβaβe) List_θf_pdeclare typede Message a MesβagePtr; ~ / ////π Cl/a/ss/e/s// oIf//J MJeIss/a/glef:/IJ Re ( qfu!e/sttl,/U Re/pIJlyI,I EI/vIeHntII &II /////////////////////////////////////////////////////////////////////// class GenericReplyClass : public Message { public: GenericReplyClass ehar aheader, CARD8 msgjyp, CARD8 msgjode, int msg_seq_no, int msgjen, ehar • msgjiata, Connection ainvoker): Message(header, msg Typ, msg code.msg seq no, msg len, msg j iata, invoke?) { pos = MSG_HEΛDER_LEN; rep Jen = 0;} O 94/24807 90 virtual iMf AjJrtates action*) - 0; ...List_of_ j i*cleτ t protected: class ReplyClass : public GenerieReplyClaaβ { public: ReplyClaβs(ehar aheader, CARD8 msgjyp, CARD8 msg code, int msg seq no, int msgjen, eϋar amsg data. Connection ainvoEer): GenencReplyClasslheader, msgjyp, msg code.msg seq no, msgjen, msg data, invoker} {} virtual msg_obj_states actιon() as Of I t class EventClass : public GenericReplyClass { public: EventClass(ehar aheader, CARD8 msgjyp, CARD8 msg code, int msg private: List(MmConnection) slist; I t class ErrorClass : public GenericReplyClass { public: ErrorClass(Conneetion ainvoker) : GenerieReplyCla__s(NULL, 0, 0, 0, 0, NULL, invoker) {} void eonnection(Conneetion ainvoker) { Invoker ■■ invoker } msg obj states action() (retarn(e MSG SERVICED); } msg~obj-states e action(CARD32 err type, CARD32 msg code, " " - " CARD32 seq no, CARD32 err_code); msg obj states success retum(CARD32 err type, CARD32 msg code7 . - " " CARD32 seq_no); private: void send error(CARD32 err type, CARD32 msg code, CARD32 seqjao, CARD32 err code); }; class IllegalMessage: public GenericReplyClass { public: UJegalMessagefehar aheader, CARD8 msg typ, CARD8 msg code, int msg seqjio, int msg len, ehar-amsg data, Connection ainvoker}: GenericReplvClaas(heaaer, msg j yp, msg ode,msg_se<i ιo, msgjen, msgjiata, invoker) msg obj states actionQ; . }; ~ " class RequestClass : public Message { Reque-rtCla^ehar .header, CARD8 msg typ, CARD8 msg code, int msg seq no - Lut - β ^ έtd ' τt hit msgjen, ehar •msgjiata, Connection • invoke?): Ma-aagejbeader, msgjyp, msg_eode,msg_seq_no, msgjen, msg data, invoker) { resjen ■ - le ; — — error * ne ErrorClaβs(invoker); ~RequestClaaβ() { delete error; } ErrorClaaa •error_obj() { return error; } virtual msg_obj_sXates action() ■» 0; protected: ErrorClaas «eιτor; int resjen; // residue length of data class MedServRequestClass: public RequestClass { public: , MedServRequestClass(RequestClaas astimulant msg, ehar * header, CARD8 msgjyp, CARD8 msg code, int msg seq_no, int msgjen, ehar *msg data,~Connection •invoker, int proom, Media pmedia, Stringέ puser desc): RequestClass(header, msgjyp, msg ode,msg seq_no, - msgjen, msgjiata, invoker) stim j nsg -> stimulantjnsg; media ■■ pmedia; userjiesc -m puser_desc; room « proom; RequestClass *stimulant() { return stim msg } msg_obj_statea action() { retvm(e MSG~5ERVICED); } virtual void special actiαu(Block(cJ__ar)& " reply data, int rdata len) -> 0; ehar • reques j>uiTer() { return (reqjraf); } " ~ protected: void common build(); void (ill request header^); Bloek(ehar) req_ uf; RequestClass •stimjnsg; Media media; String userjiesc; int room; - } ; class MRMRRequestClass : public RequestClass { public: MRMRRequestClass(ehar aheader, CARD8 msgjyp, CARD8 msgjode, int msc seq_no, int msgjen, ehar * msgjiata, Connection « invoker): RequestClaas i-ieader, msgjyp, * msg ode,msg seq_no, msgjen, msg data, invoker) { 7 virtual msg j obj j tates aetioόX) * = 0; protected: int routing_action(); I F #endif 92 #ihadef # define # include <commαn ι> # include <ifacei> # include <clientJι> Li_rt_of >declare(Loca-Session) ri f 0 f n cclare ist_of_pdee FrontEnd) S o i eciore I_istj>l_pdeel«e(ReqMR) Lw j__D2"i£e class CommObjMgr { public: CommObjMg MRInterface * ifaee); 'CommObjMgrO {} virtual void proeess(MmConneetion pconn) -> 0; int IaA]ive() { return(-S_aiive); } protected: MRInterface • Ifaee; int is_a_ive; int nextjd; iϊ class LocalSessionMgr : public CommObjMgr { public: LocaiSess αMgrfMRInterfaee * ifaee) : CommObjMgrtiface) { is_aϋve — 1; } void process(MmCoo_nectiαQ pconn); private: void garbage eoUectQ; Li__t_of_p(Loe2Se-_sion) client_list; > class FrontEndMgr : public CommObjMgr { public: FrontEndMgr(MRInterfaee *ifaee) : CommObjMgrtiface) { is_alive = 1; } void procesa(MmConnectioή pconn); void GetObjectList(List of_ (FrontEnd)& fend list) { feud a list -» cGent jist; } - private: void garbage coileetQ; List of p(FrontEnd) client list; } ; class ReqNMMgr : public CommObjMgr { public: ReqNMMgr MRInterface • ifaee); void procea-_ΩrfmConnectioα pconn); int send Jo jNM(M* m age amsg); private: ReqNM «nm obj; } ; class ReqMRMgr public CommObjMgr { public: ReqMRMgifMRInterfaee • ifaee) : CommObjMgr(iface) { _s_aϋve -» 1; } void proeessέMmConnection pconn); - int send_to_MR(String machine, int port, Message •msg); private: void garbage coileetQ; List of_p(ReqMR) server list; obj manJi >; ... ut_of_ 4ecisrt #endi proto.h proto.h #_fhd«f MR PROTO H # define ^βTPROTCTH 1 #ineiude <mr msg-h> #inelude <me3βerv ms Jι> # include <generatori> # include < common Jι> class Protocol { public: ProtoeoKMRInterfaee •ifaee); "Protocol^) {}; void interpret J-e der^ char • header, CARD&fc type, CARD8* opcode, Message .eonstnιet_msg(ehar .header, CARD8 pefcΛiSfc C «Se?* ^ CARD32 seq, CARD32 len, ehar .data, Conneetion .^ nn); private: MessagePtr (•Gen June jablMAX MSG TYPESIIMAX MSGSlVehar • MRInterface .ifi?* ° ABDt ' "CAM 2 ' CABDM ' ' *- • • S ώ- -* Convert «Conv; }; #endi room.h r - Λ o Λ o-m,.n τ. #i&daf ROOM H # define __ROOM_H 1 # include <NM typeβ_h> #inelude <eomnwnJι> # include <String-h> # include <system_protoJ»> List_of_pdeelare(Conferee) List_θf_J>declare class Conferee { public: Conferee(int cjd) { id « c id; } "CbnfereeO; - - int EH) { returned); } void add_media(Med_aDese med): void dropjnedύμMediaDese med); void suspendjnediatMediaDesc med); - void suspend jnedia(L_at of_p(MediaDesc)& med list); 'void resume media MediaDesc med); - void resume~media/List of_p(MediaDesc)& med_list); L-st_of_p(FuIIMediaDescJ " get_media_list() { returnfmediajist); } private: int id; ConfeήeStatus status; List_of_p(FulIMediaDesc) media_iist; // list of servers used by // this conferee I t class Meeting { public: Meetingfint meetingjd, CARD32 mowner, RoomAttrib mattr, Room *mπ_om, RoomMgr *mRMgr); "Meeting(); int Meetingld() { returned); } int num onferees() { retum(conf Iist.length()); } MeetingXttrib get_meeting attrib() " { return(attrib); } void set_meetingjttrib MeetingAttrib m attrib) { attrib <_■ m attrib; } void getjneetingjhfo Li3t(Partieipantinfό)& info); - void ge jneetingjj>artιcipants(List(int)& plist); int get meeting j>wner() { return owner; } MeetingStatus getjneeting tatus() { return status; } int add_partieipaήt(ύ-t participant): int drop participant int participant); void add_media(int participant, MediaDesc med): void drop_media(int participant, MediaDesc med); void drop jnedia/MediaDesc med); void restrict meαia acceM(Liβt(int)& part jist, MediaDesc med); void suspendjnedia^MediaDesc med); - void resumejnedia^MediaDesc med); int suspend neeting(); int resume meeting(); int state_eEeck(); int leavejneeting(int participant, List_of_p(MediaDese)& media_ϋst); int reenterjneeting(int participant, List_ f_p(MediaDesc)& mediajist); private: void dro j_ll_partieipants(); void change j>wner(); int id; Room «room; CARD32 owner; MeetingAttrib attrib; MeetingStatus status; room ' h room.h ... iΛ.of j dec r, enum MRScope { e_MEEΗNG_SCOPE, e_ROOM_SCOPE }; struct MediaSer erlnfoInRoom { int server MediaServerStatus status; MRScope scope; i List_ofjpdeclare(MediaServerInfoI__Room) List θf_pdeclare class Room { public: - Room(int room id, CARD32 rowner, RoomAttrib rattr, String* rname, RoomMgr *rRMgr); ~Room(); int RoomJd() { return id); } int MRId() { returnfMR id); } int IsCloβed { ra*urn(annb); } String RoomNamef) { returnfroom name); } void meet_ng_destroyed(); - void meeting~created(Meeting« m); RoomAttrib room_ ttrib() { retumfattrib); } void set ooinjtttribfRoomAttrib r attrib) { attrib -> r attrib; } RoomStatus rbom_status() { returnfstatus); } ~ RoomLockStatus room lock statusf) { retuxnfloek status); } void setjoom rtatnefHnoπiStatni r status) { status »- r status; } int haajήeetingf) { retum meeting " ? 1 : 0); } - Meeting-* et_meeting() { retu n meeting); } int add serverfint server id, Media media, String* user desc, Listfint)* part jist); int drop jerverfint server jd-Media media, String* user desc); int suspeήd e ver int seiverjd iedia media, String* user desc); int resume Terverfint serve jHjviedia media, String* user αesc); int set access listfint server-id, Media media, String* user desc, - Listfint)* part list); int list ervers(Listj>fj>(Ful_MediaDesc)& meδa ist); int is jerver_present(int server id); - void associated ervers(List(int)& servjist); void MediaServerDied(iβt m); ~ int lock(); int unlockQ; int state neekf) { return 0; } private: void set neetingfMeeting •■»); int id; - String roomjiame; Meeting .meeting RoomAttrib attrib; CARD32 owner; int MRjd; RoomStatus status; RoomLockStatus lock tatus; RoomMgr .RMgr; ~ EventNotifier .EveNot; MediaServerMgr aMSMgr; List of_j>(MediaServerInfoInRoom) server list; - // list of all servers (meSia ids) in the room int err; } ; List_of .deelare(Room) LUt_θf_p declar 97 room.h - ro~o « m—.α // All int retβna will be -ve if error. ALL ERR_CODE β are -ve ...L i st.o it e l sr t class RoomMgr { public: RoomMgrfMRInterfaee «MRIface, Range r); "RoomMgrf); MRInterface aMRIfaeef) { retumflfaee); } int is valid roomfint room id); int IsServerPresentfint room id, int server id); void AasoeiatedServeninRoomfint room id.HListfint)* slist)* int ActiveRoomf) f returnfactivejoom- >RoomId(j); } int CreateRoom(CARD32 owner, RoomAttrib attrib, String* rname.- int DestroyRoom(CARD32 requester, int id); int ListRooms(CΛRD32 reαuester. Listfint)* rlist, ListfString)* name list); 'int ShowRoomStatusfCARDtf requester, int room id, RoomStatus* stat, RoomLockStatusS. lock stat); int ShowRoomAttributesfCARD32 requester, int room id, "RoomAttrib* attrib)- int AlterRoomAttributesfCARD32 requester, int room d, RoomAttrib at t rib)' int LockRoomfCARD32 requester, int room id); ~ int UnlockRoomfCARD32 requester, int roolnjd); int CreateMeetingfCARD32 owner, int room id, MeetingAttrib attrib); int DestroyMeetingfCARD32 requester, int meetingjd); int ListMeetingsfCARD32 requester, Listfint)* rfi-rtf; int ShowMeeting-5tatus(CARD32 requester, int meeting id, LiβtfPartieipanUnfo)* info, int* p room id, - 1st* owner, MeetingStatus* status); — int ShowMeetRoomStatns(CARD32 requester, int room id, ListfParticipantinfo)* info, int* p meeting id,~ int* owner, MeetingStatus* status); ~ int L-StMeetingPartieipantsfint meeting id, Listfint)* plist); int ShowMeetingAttributesfCARD32 requester, int meeting id, MeetingAttrib* attrib); ~ int AlterMeetingAttributes(CARD32 requester, int meeting id, MeetingAttrib attrib); ~ int ShowAssociatedRoomfCARD32 requester, int meetingjd, int* room Td); int ShowAssoeiatedMeeting(CARD32 requester, int roomjd, int* meeting id); int AddParticipantfCARD32 requester, int meetingjd, int ' participant): int DropPartieipanuCARD32 requester, int meeting * id. int participant); int SuspendMeeting(CARD32 requester, int meetingjd); int ResumeMeeting(CAJRD32 requester, int meeting d); void MediaServerDiedfiut m); int AddServerfint roomjd, int server id, Media media, String* userjiesc, Listfint)* par jist); int DropServerfint room id,- int server jd, Media ' med a, String* userjiesc); int SuspendServeWittt roomjd, int serverjd, Media media, String* user esc); int ResumeSer erfmt roomjd, int server d, Media media, String* userjiesc); int SetAceeasListftnt room d, int server d, Media media, ~ String* user dese, Listfint)* part jist); int ListServersfCARD32 requester, int room id, * ~ List_of_D(FuDKIediaDese)* media jist); int LeaveMeetingfCARDS? requester, int meeting id, - List_ofj>(MediaDesc * media_list); int ReenterMeetingfCARD32 requester, int meetingjd, ~ L_st_of_p(MediaDesc)Ji media_list); private: int generate_room _d(); void free_roomjdiint id); int generatejneetingjdO; room.h room.h void freejneetihgjαfint id); ■Listj>l__pitcl*τe that is currently active O 94/24807 99 8 erver_re β .h server.reg.h #ifbdaf SERVER REGISTRY # define .SERVEHTREGISTRY-! # include <ListJι> # include <NM_ty «βJι> # include <syaent_h> # include <StringJι> #ineiude <ioβtream_h> # include <{stream.h> # include < common Jι> βtruet MediaServerlafo f MediaServerlnfofMedia pType, String* pUserDesc, MediaServerConn* pConn, String* plnitiaiizer String* pOtherlnfo); Media MediaType; String UserDese; - String Initialiser; String Otherlnfo; MediaServerConn Conn; struct MRServerConnlnfo f MRServerConnlnfofString* pMaehine, int pPort, int pStartRange, int pEndRange) { Machine -« pMaehine; Port <_■ pPort; StartRange -> pStartRanie: EndRange - pEndRange; } String Machine; int Port; int StartRange; int EndRange; I t L-3t_of_pdeclarefMediaSerrerInfo); List-o__pdeclarefMRServerConnInfo); class ServerRegistry { public: ServerRegistryfMRInterface « ifaee, String p in file); void ListAUMediaServerinfcfList of >(Medιa5erverLafo)* plist); void ListAllMRServerConninfofL st of p(MRServerConnInfo)* slist); MediaServerlnfoa ListMediaServerinTofMedia med, String* key); int in my rangefint id) f return ((id >= MyStartRange ** id <= MyEndRange) ' 1 : 0) int server forjd(int id, String* mach, int* port): void default jiame_seπrer(String& mach, int* port); void my angefRaage* r) { r-start = MyStartRange; r.end = MyEndRange; } private: void read JUeQ: void my void flusE CSAk MRInterface alfaee; List of pfMediaServerinfo) MediaServerList; List-o >(MRServe-ConnInfo) MRServerList; String MyName, name serverjnaehine; int MyStartRange, MyEndRange, name erver_port; String in jϊle, out ile; - }; #endif O 94/24807 100 client. C client. C # define DEBUG 1 # include <ifacaJt> # include <roouL_h> #ineiude <ciient-h> # include <server egJι> List_of_pimplementfSeqNoPair) List__of_pimplement # define OTECK.MMC.COΝΝECTIOΝfeonn) if (conn- >IsAaβignedO — MmEnum:ΛimFalseU \ deactivate self(); \ " rβtuf nf— I); \ # define VOID CHECK_MMC 1 CONNECTIONfeonn) if (conn- >IsAssigned() -_ MmEnum::MmFalse){ \ deactivate elffj; \ n x return; \- Blockimplementfchar) Blockimplemen int Connection "header len « MSG HEADER LEN; //MRInterface a Connection::Iface = (MRInteTfaee a)NULL; //Bloek(ehar) Connection::buf(INIT_MAX_BUFLEN); Connection:. * Conneetion(MRInterface a ifaee, MmConnection pconn) Connection // if (Ifaee ... NULL) { Ifaee >• ifaee; i Prot a> Iiace- >Protof); alive -* l; conn -> pconn; {' void Connection::client_dead() client dea { NW- >HangUpfeonnection()); alive -= 0; > void Connection::reρlyjor_routed_msg(Message amsg, ehar aheader, ~ ~ ~ ehar adata, int data len) { #ifdef DEBUG cout < < "Redirecting reply from Server.\n"; cout.flush(); #endif if (send(header, header len) < 0)f cout < < "Write " Error: " < < FILE < < < < (int)_JLINE__ < < endl; delete msg; return; if (sendfdata, data len) < 0){ cout < < "Write Erroπ: ' < < FILE < < < < (int)__LINE_ < < endl; delete msg; } void Connect.on:_send_di3conneetf) send disconnec { ehar tmpbuf(20]; tmpbuffMSG HOFFSET TYPE] = REQUEST MR SERVER; tmpbuflMSG " HOFFSET-CODE] - MR DISCONNECT; ConvO- >IntToBufϊO, tmpbuf+MSG HO FSET SEQ); ConvQ- >IntToBuf(0, tmpbuf+MSG " HOFFSETT.EN); O 94/24807 101 client.C client.C i iff ffsseennddffttaappbbuuff,, MSG_HEADER_LEN) =- - 1) f ...«« _i«eo « .« t deacthrate elfO int Connection.-sendfchar adata, int len) send CHECK MMC CONNECπθN(eonn) if (NW- > Writefeonn, data, len) < len) f deactivate selff); retumf- I); returafO); int Connection:_send(Message amsg) send CHECK MMC σθNNECTION(conn) . if (NW- > Writefeonn. msg- > msg headerf), MSG HEADER LEN) < MSG HEADER LEN){ deactivate selff); - ~ returnf— I); CHECK_MMC CONNECΗON(conn) if (NW- > Writefeonn, msg- > msg_dataf ), msg- > msg len()) < msg- > msg len())f deactivate selff); - ~ retumf— ϊ); retumfO); int Conneet-on:-sendfMedServRequestClass amsg) send CHECK MMC CONNECTION(conn) if (N > Writefeonn. msg- >msg_header(), MSG HEADER LEN) < MSG HEADER LEN)f deactivate selff); - - retumf— I); CHECK MMC CONNECTIONfeonn) if (NW- > Writefeonn, msg- >request_bufferf), msg- > msg lenf)) < msg- > msg len())f deactivate self(); - — _ retumf— ϊ); returnfO); void Connection::client_Droeess_fflsgf) client___procesS_τnsg CARD8 type, opcode CARD32 msg eq, msgjen; Message a mac ~ enum msg_ooj tates status; VOID CHECK MMC CONNECTIONfeonn) if (NW- >Rea3(header, header ien) < header len)f #ifdef DEBUG cout < < "Read Error:: " < < FILE < < " " < < (int) LINE < < endl; #endif -- — — deactivate elff); i ff ui n; } Prot— > interpret headerf header, type, opcode, msg seq, msg len); #ifdef DEBUG - " cout < < " Len:" < < msg len < < " " < < msg seq < < " Type: " < < (int)type-< < " Opcode: " < < " (int)opcode < < endl; cout.Ωush(); #endif O 94/24807 102 client. C client. C if (mar n > 0) f ...cff« _ pM „«_ Λ- , bnfjaaervefmsf len); VO CBEC ' MMC CONNECTION(eo_ιn) #ifdef DEBUG 1 ' ^- ^^ « ■ * »> < -»< «k #endlf βPβt < βRβmd E θr" " < - ?1LE — < " * << fi»t)__LINE__ < < en deaetivate_self(); return; } } i s « P^ >constroet_msgfheader, type, opeode, msg eq, msgjen, buf, this); e MSG SERVICED: default " delete msg; break; } } } // ciient_process_msg Connection:: * Connectionf) Connectio { LocalSession::LocalSession(MRInterface aifaee, MmConnection pCIi) LocalSessio : Connection(_faee, pCIi) void LocalSession::proce-_s_msgf) process ms client_prece33_msg(); } // process_msg - I IllJl FraIintEnidJl l ////////////////////////////////////////////////////////////////////// FrontEnd:_FrontEnd(MRInterface aifaee, MmConnection pCIi) FrontEn : Coonection(iface, pCIi) void FrontEnd:φrocesa_msgf) processjns client _process_msgf); } // process j nsg - ////////////////////////////////////////////////////////////////////// // eqMK Methods ////////////////////////////////////////////////////////////////////// ReqMR::ReqMRfMRInterface aifaee, MmConnection serv) : Connection(iface, serv) { O 94/24807 1∞ cIient * C cIient.C ' ...proctat msf void ReqMRr-proeess_msgf) pr θ CC SS _msg CARD8 type, opcode; CARD32 msgjeq, msg len; Message amsg - enum msg ioj tates status; VOID CHECK MMC CONNECTION(conn) if (NW- >Reaa(header, header len) < header len){ #ifdef DEBUG " - ' cout << "Read Error: " << _FILE__ << " " << (int)_JINE__ << endl; # endif deaetivate eiff); return; ~ } - Pret— > interpret jieaderfheader, type, opcode, msg j eq, msgjen); cout << "Received from other MR Server:: Len:" << msg len << " " << msg seq << en cout.flush(); # endif if (msg len > 0) f " &uf.resenrefmsg len); VOID CHECK " MMC CONNECTIONfeonn) if (NW- >Reaa(buf,-msg len) < msg len){ #ifdef DEBUG cout << "Read Error: " << __F1LE << " " << (int) LINE << endl # endif deactivat elff); return; > ' requestjnsg— >MsgSourcef)— > repl orjoutedjnsg request j nsg, "" header^ buf, msgjen); " ~ send_disconnectf); ~ } // processjnsg ReqNM::ReqNM(MRInterface aifaee, MmConnection serv) ReqNM : Connection(ifaee, serv) nm eqjio ■» 0; int ReqNMi-sendj-equestjnsg^esaage amsg) Send_request_msg nm seq no- -; // SHOULD REUSE LATER SeqNoPair asp =» new SeqNoPairfmsg, msg- > msg seq_nof)); if (!sp) {• cout << "FATAL MEM ALLOC ERROR : " << (int) FILE__ << " " << (int) _LINE__ << endl; msgjist.insertjiextfsp); msg— >set msg seα_nofnm seq_no); #ifdef DmUG " - cout << "msg->seq : " << msg— > msg seq_nof) << endl; # endif retu f send( msg)); O 94/24807 104 client. C client. void ReqNM.-.proee β sjnagf) " prOCeSSJTIS CARDS type, opcode; CARD32 msgjeq, msg len; Message .in; - - Listjrf ήterfSeqNoPair) mustfmsg list); enum msgjobjjtates status; VOID CHECK MMC CONNECTIONfeonn) if (NW- >Reaa(header, header len) < header len){ #ifdef DEKJG - eout << "Read Error: " << __FILE__ << " " << (int)_LINE__ << endl; endif — " * ~"~ deactivate elff); return; } Pret— > interpret headerf header, type, opcode, msg seq, msg len); #ifdef DEBUG " - « • » ■ _. * cout << "Received from Name Server: Len:" << msg len << " " << msg seq << " cout.flush(); - - # endif if (msg len > 0) { * Buf.reservefmsg len); VOID CHECK TV-MC CONNECTIONfeonn) if (NW- >Reaa(buf, " msg len) < msg lenH #ifdβf DEBUG cout << "Read Error: " << FILE << " " << (int) LINE << e # endif " " * — "~ deactivate seif(); return; - » » // The code below presumes that the MR Server would have requested // the Name Server ONLY on behalf of a LocalSession and NEVER on its // own volition. If the latter eaae is to be taken care, we need to // write a different method for 'm' (instead of reply jbrjouted). // traverse msgjist and find requestjnsg SeqNoPair ap; - - mlist.resetf); while (miist-nextfplH m = p->GetMsg(); #ifdef DEBUG cout << "m— >seq : " << m— >msg eq j ιof) << " m— >code " << (int)m— > # endif if (m— >msg code]) -=== opeode &* m— >msg seq nof) =-= msg seq) f Convf- >IntToBuffp- >GetOrigSeq , h " eader+MSG_HOFFSET_SEQ); m— >MsgSoureef)- > reply for routed msgfm, header^ ~ - "" buf, msgjen mlist.remo-e_prevf); delete p; } } // processjnsg Kb eve_xn β g.C eve_msg.C # include <eve_msg-h> EveTemplatel::EveTemplatelfehar aheader, CARD8 msg typ, CARD8 msgjode, int msg seq io, int msg len, ehar amsg data, Connection ainvoEer, ListfMmConhection)* serverlist- int src, int roomjd, int meetingjd, int participant) : EventClassfheader, msgjyp, Tnsg ode, msg_seq_no, msg len, msg_data, invoker, serverjist) - buϋd(src, roomjd, meetingjd, participant); send ventf); - - EveTemplate2:_EveTemplate2(ehar aheader, CARD8 msgjyp, CARD8 msgjode, int msgjeqjio, int msg len, ehar amsg data, Connection ainvoker, List(MmConnectιon)* serverlist, ~ int src, int roomjd) : - EventClass(header, msgjyp, msgjode, msg_seq_no, msg len, msgjiata, " invoker, server jist) - build(sre, roomjd); sendjventf); - EveTempiate3._EveTemplate3fchar aheader, CARD8 msgjyp, CARD8 msg code, int msgjeqjio, int msg len, ehar amsg data, Connection ainvoker, ListfMmConhection)* server~list, - int src, int roomjd, int meetingjd, Listfint)* plist) : EventClassfheader, msgjyp, " msgjode, msg_seq_no, msg len, msgjiata, " invoker, server jist) " build(sre, roomjd, meetingjd, plist); sendjventf); ~ * - EveTemplate :_EveTemplate (ehar aheader, CARD8 msgjyp, CARD8 msgjode, int msg_seq ιo, int msg len, ehar amsg data, Connection « in voter, ListfMmConhection)* serverjist, int src, ~ int roomjd, int meetingjd, Media med, String* userjiesc) : EventClassfheader, msgjyp, msgjode, msg_seq_no, msgjen, msgjiata, " invoker, serverjist) - build(src, roomjd, meetingjd, med, userjiesc); send eventf); — — - } EveTemplate5:£veTemplate5fehar aheader, CARD8 msgjyp, CARD8 msg code, int msg eqjio, int msg len, char • msgjiata, Connection ainvoker, ListfMmConhection)* serverjist, ~ int src, int roomjd, int meetingjd) : ~ EventClassfheader, msgjyp, " msgjode, msgjeqjio, msgjen, msg j iata- " invoker, serverjist) - buildfsrc, roomjd, meetingjd); send eventf); - - } EveTemplate6:_EveTemplateβfehar aheader, CARD8 msgjyp, CARD8 msg_code, int msgjeqjio, int msg len, ehar • msgjiata, Connection « invoker, ListfMmConhection)* serverjist, int src, ~ int room id, int meeting id, Media med, String* user desc, Listfint)* " art list) : EventClassfheader, msgjyp, msgjode, msgjeqjio, msgjen, msg j iata. " invoker, serverjist) build(sre, roomjd, meetingjd, med, userjiesc, partjist); send vent(); eve msg.C _ - " eve αaag.C } O 94/24807 107 event. C event. C # include <«vβnt_h> # include <eve meg.h> # include <ifaet__h> # include <med_serv_h> # include <obj_manJι> # include <rooπ h> ListimplementfMmCαnneetion) Listimplement EventNotifιer_EventNotifierfMRInterfaee aifaee) EventNotifier Ifaee a« ifaee; seq_no ■- 0; void EventNotifier:_server_conn listfint room id, LStfMmConnection)*-eonaji3t) int server; Listfint) serverjist; Ifaee- >RoomManagerf)- >AssociatedServersInRoomfreom id, server list); conn list esetf); ~ ~ # ifdef DEBUG cout < < "Server List Length: " < < server list.length() < < endl; coutJluahf); # endif server list_resetf); whilβ~(server hst-neztfserverjlf conn_Iύt.insert nextfliace— > " MediaServerManagerf)- >ServerCoanection(server)); // Should also include all the FrontEnd connections in list // so tthhaatt tthheeyy ttoooo rreecceeiivvee tthi e events last of pfFrontEnd) fend jist; FrontEnd a fend; - Ifaee- >FEManagerf)- >GetObjectListffend list); fend list.resetf); while (fend iιst.nextffend)) { if (fend) conn_list.insert_next(fend— > connectionf)); # ifdef DEBUG cout < < "Event Conn List Length: " < < conn list.length() < < endl; cout.ΩushO; - # endif } void EventNotifier:-fend_conn__istfList(MmConnectioo)* conn_list) List List of pfFrontEnd) feud a list; FrontEnd fend; - conn list.resetf); Iface^ >FEManagerf)- >GetObjectList{ fend jist); fend list.resetf); ~ while (fend list.nextffend)) { if (lend) conn jist.insert_ne_rt( fend- > connectionf)); void EventNotifler:Templatel(CARD8 code, int roomjd, int src, int meetingjd, int participant) ListfMmConnection) conn_list; EveTempiatel a eve; - event.C event. C server eonn_listfreom id, conn list); " Li * if (conn lisU«ngth() " > 0) { - eve - new EveTemplatelffehar «)NULL, EVENT MR SERVER, code, next seq nof), - - 0, (char • " JNtJLL, Ifaee- >PernstentConneetion(), , , . . . . eonnjist, src, roomjd, meetingjd, participant); // constructor would have sent the event delete eve; . » void EventNotifier:Template2(CARD8 code, int roomjd, int sre, int id) Template2 ListfMmConnection) eonnjist; EveTempiate2 a eve; ~ server conn listfroom id, conn list); if (conn list_length() " > 0) f eve *- new EveTempiate2((ehar »)NULL, EVENTj R SERVER, code, next seq nof),- ~ 0, (ehar β )NULL, Ifaee- >PersistentConnection(), conn list, src, id); // constructor would have sent the event delete eve; } void EventNotifier::Template4fCARD8 code, int src, int roomjd, int meetingjd, Media med. String userjiesc) ListfMmConnection) conn list; EveTemplatee aeve; ~ fend conn listfeonn list); if (conn lStJengthf " > 0) { eve »» new EveTemplate (fchar a)NULL, EVENT J R_SERVER, code, next seq nof), - - 0, (ehar β " JNULL, Ifaee— >PersistentConnectionf), conn_iist, src, roomjd, meeting id, med, user αesc); // constructor would have sent the " event - - - delete eve; } void EventNotifier::Template5fCARD8 code, int sre, int roomjd, int meetingjd) ListfMmConnection) connjist; EveXemplateδ aeve; ~ server conn listfroom id, conn list); if (conn list-lengthf) " > 0) { ~ eve a. new EveTemplate5ffehar «)NULL, EVE T_MR_SERVER, code, next seq nof), - - 0, (ehar a " JIMULL, Ifaee- >PersistentConnection(), conn_list, sre, roomjd, meetingjd); // constructor would have sent the event "" - delete eve; . » void EventNotifιer:TempiateβfCARD8 code, int src, , ListfMmConnection) conn J st; EveTemplateβ aeve; event.C event. C #ifdef DEBUG . Templates # endif COUt < " Tβmpl * t * β: P E T _LEN: " < < ρart_list.length(); coutJlushf); fend conn listfconn list); if (conn -δtJengthfJ > 0) { eire - new EveTempiate β ffehar »)NULL, EVENT MR SERVER, code, next seq nof), - - 0, (char a" jNULL, Ifaee- >PeraistentConneetion(), conn list, src, room id, meeting id, med, usβr deβe, part list)" // constructor would have sent the event ~ delete eve; void EventNotifier:-AddedPartieipantfint roomjd, int src, int meetingjd, int participant) Templatel(EVΕ_ADDED_PARTICIPANT, roomjd, src, meeting id, - p rticipant); - ~ void EventNotifιer:DroppedParticipantfint roomjd, int sre, int ' meetingjd, int participant) Tempiatel(EVEj5ROPPED j^VRΗCIPANT, room id, sre, meeting id, participant); "* ~ void EventNotifier:-LeftMeetingfint roomjd, int sre, ~ int meetingjd, int part ipaat) Templatel(EVE_LEFT_MEETING- roomjd, src, meeting id, - " participant); - " void EventNotifier::ReenterMeetingfint room id, int sre, " int meetingjd, int participant) Tempia l(EVE_REENTER_MEETING, roomjd, sre, meetingjd, - participant); - - void EventNotifιer::MeetingDeatroyed(int roomjd, int src, int meetingjd) TemplateδfEVEj EETINGjDESTROYED, src, roomjd, meetingjd); void EventNotifier-RoomCreated(iat roomjd, int src) RoomCreated Template2fEVEjlOOM CREATED, roomjd, src, roomjd); void EventNotifier-RoomDestroyed(-nt roomjd, int sre) RoomDestroyed Template2(EVE_ROOMjDESTROYED, roomjd, sre, roomjd); void EventNotifter:RoomLoekedfiht roomjd, int sre) RoomLocked Template2(EVEJlOOMj,OCKED, roomjd, src, room_id); void EventNot_fier:_RoomUnlocked(int roomjd, int src) RoomUnlocked event. C event. C Template2fEVE_ROOM_UNLOCKED, roomjd, src, roomjd); ...RoomUnioekei void EventNotifier-MeetingSuspendedfint roomjd, int src, int meetingjd) Template5fEVEjMEETING_SUSPENDED, src, roomjd, meetingjd); void EventNotifier:_MeetingResumed(int room id, int src, ut meetingjd) Template5fEVE_MEETING_RESUMED, src, roomjd, meetingjd); void EventNotifier:-Meet_ngCreated(int roomjd, int sre, int meeting id) MeetingCreated Template5fEVE_MEETING_CREATED, src, roomjd, meetingjd); void EventNotifier::Meetinginfofint roomjd, int src, int meetingjd) Meetinglnfo ListfMmConnection) eonnjist; Listfint) plist; ~ EveTemplate3 aeve; server jonnjistfroomjd, conn_Iist); if (Ifaee— >RoomManagerf)— >ListMeetingPartieipantaf meeting jd, pfiat) < 0) return if (conn listJength() > 0) { eve a. new EveTemplate3f(ehar a)NULL, EVENT MR SERVER, EVE MEETING INFO, next seq_nof), 0, (char a)NULI, Ifaee- >PersβtentConneetion(), eonn_list, sre, room id, meeting id, plist); // constructor would have sent the " event ~ "* delete eve; } void EventNotifier::ServerAdded(int src, int roo jd, int meeting id. Media med, String userjiesc, Listfint)* part jist) Tempiate6(EVE_SERVER ADDED, src, room id. meetingjd, ~ med, userjiesc, partjlst); - void EventNotifier::ServerDropped(int src, int roomjd, int meetingjd, Media med, String userjiesc) — Template4fEVE_SERVER DROPPED, src, roomjd, meetingjd, - med,' userjiesc); - - void EventNotifier-ServerAecessListSetfint src, int room id, int meetingjd, Media med, String user j iesc, Listfint)* part jist) TemplateβfEVE SERVER ACCESS LISTJ5ET, sre, roomjd, meetingjd, ~ med, userjiesc, part_list); O 94/24807 generator.C generator.C # include <_oβtream_h> # include < generator _h> Message . ProtoGenera^^ciefault_generatorfehar . header, CARD8 type, CARD8 opeode, CARD32 seq, CARD32 len, ehar adata, Connection ainvoker) cerr < < "Illegal Message or Message not implemented: Type:" < < type < < " Code:" < < opeode < < endl; cerr.flushf); retu fnew OlegalMessagefheader, type, opeode, seq, len, data, invoker)); Message a ProtoGenerator:Gen Disconnect(ehar header, CARD8 type, CARD8 opcode, CARD32 seq, CARD32 len, char adata. Connection ainvoker) retumfnew Disconneetfheader, type, opcode, seq, len, data, invoker)); Message • ProtoGenerator::Gen CreateRoomfehar * header, CARD8 type, CARD8 opcode, CARD32 seq, CARD32 len, ehar adata, Connection ainvoker) if (len < MR CREATE ROOM LEN) retumfnew OlegalMessagefheader, type, opeode, seq, len, data, invoker)); retu fnew CreateRoomfheader, type, opcode, seq, len, data, invoker)); Message a ProtoGenerator:Gen DestroyRoomfchar a header, CARD8 type, CARD8 opeode, CARD32 seq, CARD32 len, ehar adata, Connection ainvoker) if (len < MR DESTROY ROOM LEN) retumfnew OlegalSiesaagefheader, type, opcode, seq, len, data, invoker)); retumfnew DestroyRoomfheader, type, opcode, seq, len, data, invoker)); Message ProtoGenerator.Oen ListRoomsfehar a header, CARD8 type, CARD8 opcode, CARD32 seq, CARD32 len, char adata, Connection ainvoker) if (len < MR LIST ROOMSJLEN) retumfnew UlegalMessagefheader, type, opcode, seq, len, data, invoker)); retumfnew ListRoomsfheader, type, opcode, seq, len, data, invoker)); Message a ProtoGenerstor:Gen ShowRoomStatusfehar header, CARD8 type, CARD8 opcode. CΛRD32 CARD32 len, ehar adata, Connection ainvoker) if (len < MR SHOW ROOM STATUS LEN) retumfnew OlegalMessagefheader, type, opcode, seq, len, data, invoker)); retumfnew ShowRøomStatuafheaαer, type, opcode, seq, len, data, invoker)); Message a ProtoGenerator_Gen ShowRoomAttributesfehar a header, CARD8 type, CARD8 opcode, CAR CARD32 len, ehar adata, Connection ainvoker) if (len < MR SHOW ROOM ATTRIBUTES LEN) retumfnew OlegalMessagefheader, type, opcode, seq, len, data, invoker)); retumfnew ShowRoomAttributesfheader, type, opcode, seq, len, data, invoker)) Message a ProtoGenerator:Gen AlterRoomAttributesfchar a header, CARD8 type, CARD8 opcode, CAR CARD32 len, ehar adata. Connection ainvoker) if (len < MR ALTER ROOM ATTRIBUTES LEN) retuπifnew OlegalMessagefheader, type, opcode, seq, len, data, invoker ) ); retura(new AJterRoomAttributes(header, type, opcode, seq, len, data, invoker)); generator.C generator.C Message . ProtoGene w Gen LoekRoomfchar . header, CARDS tvpe, CARDS opcode, CARD32 seq, CARD32 len, ehar adata, Connection ainvoker) len, data, invoker)); retumfnew LockRoomfheader, type, opcode, seq, len, iinnvvookkeerr))));; Message a ProtoGenerator:Gen UaloekRoom(ehar a header, CARD8 type, CARD8 opcode, CARD32 seq, CARD32 len, ehar adata, Connection ainvoker) if (len < MR UNLOCK ROOM LEN) retumfnew OlegalMessagefheader, type, opcode, seq, len, data, invoker)); retumfnew UnlockRoomfheader, type, opcode, seq, len, data, invoker)); Message • ProtoGenerator::Gen ShowAssociatedRoomfehar a header, CARD8 type, CARD8 opcode, CARD CARD32 len, char adata, Connection ainvoker) if (len < MR SHOW ASSOCIATED ROOM LEN) retumfnew OlegalMessagefheaaer, type, opcode, seq, len, data, invoker)) return(new ShowAasocιatedRoom(hcader, type, opcode, seq, len, data, invoker)); Message • ProtoGenerator:Gen SbowAssoeiatedMeetingfchar a header, CARD8 type, CARDS opcode, CA CARD32 len, char adata, Connection ainvoker) if (len < MR SHOW ASSOCIATED MEETING LEN) retumfnew fllegalMeasagefheacler, type, opcode, seq, len, data, invoker)); retumfnew ShowAseociatedMeetingfheader, type, opcode, seq, len, data, invoker)); Message a ProtoGenerator.-Gen CreateMeetingfehar a header, CARD8 type, CARD8 opcode, CARD32 seq CARD32 len, ehar adata, Connection ainvoker) if (len < MR CREATE MEETING_LEN) retumfnew OlegalMessagefheader, type, opcode, seq, len, data, invoker)); retumfnew CreateMeetingfheader, type, opcode, seq, len, data, invoker)); Message • ProtoGenerator:Gen DestroyMeetingfehar a header, CARD8 type, CARD8 opcode, CARD32 s CARD32 len, char adata, Connection ainvoker) if (len < MR DESTROY MEETING LEN) retumfnew DlegalKfessagefheaSer, type, opcode, seq, len, data, invoker)); retumfnew DestrσyMeetingfheader, type, opcode, seq, len, data, invoker)); Message • ProtoGenerator-Gen ListMeetingsfehar a header, CARD8 type, CARD8 opcode, CARD32 seq, CARD32 len, ehar *data. Connection ainvoker) if (len < MR LIST MEETINGS LEN) retumfnew IUegalMessagefhesder, type, opcode, seq, len, data, invoker)); retumfnew ListMeetingsfbeader, type, opcode, seq, len, data, invoker)); Message • ProtoGenerator:Gen ShowMeetingStatusfchar a header, CARD8 type, CARD8 opcode, CARD CARD32 len, char adata, Connection ainvoker) if (len < MR SHOW MEETING STATUS LEN) retumfnew OlegalMessagefheader, type, opcode, seq, len, data, invoker)); retumfnew ShowMeetingStatusfheader, type, opcode, seq, len, data, invoker)); Message • ProtoGenerator::Gen_ShowMeetRoomStatus(char a header, CARD8 type, CARD8 opcode, CA generator.C generator.C CARD32 len, ehar adata, Connection ainvoker) *«i> 1«. <*«*- invoker)); retumfnew ShowMeetRoomStatusfheader, type, seq, len, data, invoker)); Message . PretoGenen^^n ShowMeetingAttributtsfehar a header, CARD8 type, CARD8 opeode, CAR CARD32 len, ehar adata, Connection ainvoker) if (len < MR SHOW MEETING ATTRIBUTES LEN) retumfnew OlegalMessagefheader, type, opcode, seq, len, data, invoker)); retumfnew ShowMeetiagAttributesfheader, type, opeode, seq, len, data, invoker)); Message a ProtoGenerstor::Gen AlterMeetingAttributesfehar a header, CARD8 type, CARD8 opeode, CAR CARD32 len, ehar adata, Connection ainvoker) if (len < MR ALTER MEETING ATTRIBUTES LEN) retumfnew 01ega_Messagefl_eader, type, opcode, seq, len, data, invoker)): retumfnew AlterMeetingAttributesfheader, type, opcode, seq, len, data, invoker)); Message a ProtoGenerator::Gen AddParticipantfehar a header, CARD8 type, CARD8 opeode, CARD32 se CARD32 len, char adata, Connection ainvoker) if (len < MR ADD PARTICIPANT LEN) retumfnew DlegalMessagefheader, type, opeode, seq, len, data, invoker)); retumfnew AddParticipantfheader, type, opcode, seq, len, data, invoker)); Message a ProtoGene ator-Gen DropParticipantfehar a header, CARDS type, CARDS opcode, CARD32 s CARD32 len, char adata, Connection ainvoker) if (len < MR DROP PARTICIPANT LEN) retumfnew Dlega-Meaaagefheaάer, type, opcode, seq, len, data, invoker)); retumfnew DropParticipantfheader, type, opcode, seq, len, data, invoker)); Message a ProtoGenerator xen LeaveMeetingfchar a header, CARD8 type, CARD8 opcode, CARD32 seq, CARD32 len, ehar adata, Connection ainvoker) if (len < MR LEAVE_MEETING LEN) retumfnew fllegalMessagefBeader, type, opcode, seq, len, data, invoker)); retu fnew LeaveMeetingfheader, type, opcode, seq, len, data, invoker)); Message • ProtoGenerator:Gen ReenterMeetingfehar a header, CARD8 type, CARD8 opcode, CARD32 s CARD32 len, ehar adata. Connection ainvoker) if (len < MR REENTER MEETING LEN) retumfnew OlegaflCleasagefheaHer, type, opeode, seq, len, data, invoker)); retumfnew ReenterMeetiagfheader, type, opeode, seq, len, data, invoker)); Message • ProtoGenerator-Gen SuspendMeetingfchar a header, CARDS type, CARD8 opcode, CARD32 CARD32 len, ehar adata, Connection ainvoker) if (len < MR SUSPEND MEETING LEN) . ,. retumfnew OlegalMessagefheaier, type, opcode, seq, len, data, invoker)); retumfnew SuspendMeetingfheader, type, opeode, seq, len, data, invoker)); Message . ProtoGenerator:Gen ResumeMeetingfehar a header, CARD8 type, CARD8 opcode, CARD32 CARD32 len, ehar adata, Connection ainvoker) if (len < MR RESUME MEETING LEN) , _, . . » retumfnew OlegalMessagefheader, type, opcode, seq, len, data, invoker)); generator.C generator.C retumfnew ResumeMeetmgfheader, type, opcode, seq, len, data, invoker)); Message • ProtoG β eratw&en AddSeπrerfehnr . header, CARD8 tvpe, CARD8 opeode, CARD32 seq, CARD32 ten, ehar adata, Connection ainvoker) If (len < MR ADD SERVER LEN) retunJnew uleea-Meei-_g«f header, type, opeode, seq, len, data, invoker)); retumfnew AddServerfheader, type, opcode, seq, len, data, invoker)); Message a ProtoGenerator:Gen DropServerfehar a header, CARD8 type, CARD8 opeode, CARD32 seq. CARD32 len, char adata, Connection ainvoker) if (len < MR DROP SERVER LEN) retumfnew iHegalMessagefheader, type, opcode, seq, len, data, invoker)); retumfnew DropServerfheader, type, opeode, seq, len, data, invoker)); Message a ProtoGenerator:Gen SetServerAecessListfehar a header, CARD8 type, CARD8 opcode, CARD3 CARD32 len, char adata, Connection ainvoker) if (len < MR SET SERVER ACCESS LET LEN) retumfnew " πiega-Messaaef header, type, opcode, seq, len, data, invoker)); retumfnew SetServerAeeessLbtfheader, type, opeode, seq, len, data, invoker)); Message • ProtoGenerator-Gen ListServersfehar • header, CARD8 tvpe, CARD8 opcode, CARD32 seq, CARD32 lea, ehar adata, Connection ainvoker) if (len < MR LIST SERVERS LEN) retumfnew ΗlegalMeasagefheader, type, opeode, seq, len, data, invoker)); retumfnew ListServenfheader, type, opcode, seq, len, data, invoker)) Message a PretoGenerator_Gen GetServerlnfofehar • header, CARD8 type, CARD8 opcode, CARD32 seq, CARD32 len, char adata, Connection ainvoker) retumfnew GetServerlnfofheader, type, opeode, seq, len, data, invoker)); Message a ProtoGenerator:Gen SnspendServerfchar a header, CARD8 type, CARD8 opcode, CARD32 se CΛRD32 len, char adata, Connection ainvoker) if (len < MR SUSPEND SERVER_LEN) retumfnew OlegalMessagefheader, type, opeode, seq, len, data, invoker)); retumfnew SuspendServerfheader, type, opcode, seq, len, data, invoker)); Message a ProtoGeneratαR-Gen ReeuineServerfchar a header, CARD8 type, CARD8 opcode, CARD32 seq CARD32 len, char adata, Connection ainvoker) if (len < MB RESUME SERVER LEN) retumfnew OlrgBMseaigefSeader, type, opcode, seq, len, data, invoker)); retumfnew ReβumβServerfheader, type, opcode, seq, lea, data, invoker)) ' Message a ProtoGenerator Sen NameServerMsgfehar a header, CARD8 type, CARD β opcode, CARD32 CARD32 len, char adata, Connection ainvoker) retumfnew NameServerMsgfheadex, type, opcode, seq, len, data, invoker)); Message a PτotoGeneratαr_Gen CreateUserfehar a header, CARD8 tvpe, CARD8 opcode, CARD32 seq, CARD32 len, char adata. Connection ainvoker) retumfnew CreateUserfheader, type, opcode, seq, len, data, invoker)); O 94/24807 115 generator.C generator.C Message a ProtoGenerator Sen CreateDupUserfchar a header, CARD8 type, CARD8 opcode, CARD32 seq CARD32 len, ehar adata, Connection ainvoker) retumfnew CreateDupUserfheader, type, opeode, seq, len, data, invoker)); Message • ProtoGenerator::Gen DeleteUserfehar a header, CARD8 type, CARD8 opeode, CARD32 seq, CARD32 len, ehar adata, Connection ainvoker) retumfnew DeleteUserfheader, type, opeode, seq, len, data, invoker)); Message • ProtoGenerator::Gen GetPersonlnfofchar • header, CARD8 type, CARD8 opeode, CARD32 seq, CARD32 len, ehar adata, Connection ainvoker) retumfnew GetPersonlnfofbeader, type, opcode, seq, len, data, invoker)); Message • ProtoGenerator::Gen CreateNMEntryfehar a header, CARD8 type, CARD8 opcode, CARD32 se CARD32 len, ehar adata, Connection ainvoker) retumfnew CreateNMEntryfheader, type, opeode, seq, len, data, invoker)); Message a ProtoGenerator::Gen DeleteNMEntryfehar a header, CARD8 type, CARD8 opeode, CARD32 se CARD32 len, char adata, Connection ainvoker) retumfnew DeleteNMEntryfheader, type, opcode, seq, len, data, invoker)); Message • PrσtoGenerator:Gen GetNMEntryfehar a header, CARD8 type, CARD8 opcode, CARD32 seq, CARD32 len, char adata, Connection ainvoker) retumfnew GetNMEntryfheader, type, opcode, seq, len, data, invoker)); ifacβ - c iface.C #deilne DEBUG 1 #deΛne DEFAULT NFUT_REGETRY "SERVDESC" # define DEFAULT ROOM START 0 # define DE_FAULT " RθOM_ΕND 1000 # include <ifaceh> # include < clien _h> # include <sysent_h> # include <stdlib ι> # include <room_h> # include <aerrer_re*_h> # include <ebjjnanJ__> # include <stream.li> # include <med_servJι> # include < event. h> //# include <Args.h> Listj>fj ) implementfCommObjMgr) List_θf__pimplement MRInterface aG_Iface; mainfint argc, char aargv[]) main cout << "Staring Server\n"; cout_flush(); G Ifaee - new MRlnterfaeeQ; GTfaeβ— >staιtupfarge, argv); void MRInterface:_startup (int argc, ehar aaargv) tartup int port - MR CLIFACE PORT; String in file a. DEFAULT INPUT REGISTRY; int c;- - - extern ehar aoptarg; extern int optind; Range range; FE Jort a. *M FEND PORT; while "" f(c == getop farge, " argv, "f:p:i:o:")) !» - 1){ switch (c) f a 'p': port =- atoifoptarg); break; T: FE_port » atoifoptarg); break; *i': in_fDe •__ optarg; default: cout < < "Usage: MRServer [-p < client J»rt>] [-f <frontend_port>l [ exitfl); if (NW- >ActivateServerPortfport) !-> MmEnum:_MmOK)f cout < < "Cannot open listening port...\n"; coutjlushf); exitfl); if (NW- >A c cctttiiivvva, teServerPortfFΕ port) .= MmEnum:_MmOK){ ccoouutt < < < "Cannot open Trent end listening port...\n ; cout.flushf); exit(l); *«e.C iface.C } ..Dtsrtap If (!(SReg - new ServerRegistryfthis, in file))H eout < < "Fatal Memory Alloc. " Error " < < FILE < < "•" « _JJNE_ < < endl; "~ — exitfl); SReg- >my_rangef range); MSMgr - new MediaServerMgrfthis); if (IMSMgr) { eout << "Fatal Memory Alloc. Error " < < FILE << ":" < < _LINE__ < < endl; "" ~~ exitfl); objeet_Iist.insert_nextf (CommObjMgr a)MSMgr); NMMgr * new ReqNMMgrfthis); eout < < "Fatal Memory Alloc. Error " < < FILE << ":" < < __LINE < < endl; "~ "~ ^ exitfl); - - if (INMMgr- >IsAUvef)K cout < < "Cannot talk to NameServer. Exiting.. A a"; exitfl); object Jist .insert jiextf (CommObjMgr »)NMMgr); MRMgr a. new ReqMRMgrfthis); eout << "Fatal Memory Alloc. Error " << FILE << ":" < < LINE < < endl; "~ "" exitfi); - ~ object JjstJnsertjiextff CommObjMgr a)MRMgr); Range rangel; // range -start -« rangel.end ■__ 0; rangel-start -_■ range_start; rangel.end _-_ range.end; if (ifRMgr = new RoomMxrfthis, rangelM eout < < "Fatal Memory Alloc. Error " < < FILE < < ":" << LINE < < endl; " ~ "~ exitfl); " " LSMgr = new LocaiSesaionMgrfthis); if fJLSMgr) { coot < < "Fatal Memory Alloc. Error " < < FILE < < ":" << LINE < < endl; exitfl) — - object_Ust-inaertjιextf(ComjnObjMgr a)LSMgr); FEMgr . new FrontEndMgifthis); if (IFEMgr) { cout < < "Fatal Memory Alice. Error " < < _ F1LE__ < < ":" << LINE < < endl; exitfl); ~ // THIS WILL NOT BE INSERTED IN THE OBJECT LIST 1/ HANDLE AS SPECIAL CASE IN main oop if (!(ConvMethods - new Convertf)))f cout < < "Fatal Memory Alloc. Error " < < __ FILE__ < < < < _LΪNE__ < < endl; exitfl); O 94/24807 118 i a e.C iface.C if (!(Prot - new Ptotoeol(this))K ...stsrta eout < < "Fatal Memory Alloc Error " < < FILE < < < < _LINE__ < < endl; ~~ — exitfl); — — This is a dummy connection — used to initialise some objects which need a Connection* ( (!.f(PP.ersC " onn a. new ReqMRfthis, MmConneetioo()))M cout < < "Fatal Memory Alloc. Error " < < FILE < < < < LINE < < endl; * "" exitfl); — if (!(EveNot = new EventNotiJierfthis))){ cout < < "Fatal Memory Alloc. Error " < < FILE << < < LINE < < endl; ~~ exitfl); - — main oopf); vvo« id M MRInterface::maύ__loop () main Jo o { List of piterfCommObjMgr) olistfobject iat); CommObjMgr aobj; ~ // NW- >Blockf); f ~ <ϋ><W- >Selectf) !« Mm£num::MmOK) If (NW- >CurrentCon nneeeettiioonn(}-— >ServerPortf) =-« FE_port) f // Special cmm: msg from front end ' FEMgr— >proeessfNW-> >CurreatCooneetioo()); i . olist.resetf); while (ohstjiextfobj)) obj— >processfNW— >CurrentConnection()); ) void MRInterface::garbage collectf) garbage olle i MRInterface::"MRIntβrfaeef) MRInterfa if Prot) deleu Prot ; if RMgr) delete RMgr; if SReg) delete SReg; if MSMgr) delete MSMgr if NMNξr) delete NMMgr, if LSMgr) delete LSMgr; if MRMgr) delete MRMgr; if EveNot) delete EveNot; if PersConn) delete PersConn; if FEMgr) delete FEMgr; } void shutdownf) shutdo if (G face) delete G_Iface; ifaee. C tf« e.C exitfl)} ■ •*k- έ»wa med_ β erv.C med.aerv.C # include <iface ι> # include <rooa_ h> # include < clien Jh> #inelude <med_aβrvJι> # include <server-regJi> i z i/iimiiimmiiimiiiimiiiiiiii 1 i 1 i 1 i 1 i 1 ii 1 i 11 ii 1 i 11 i 1 i 1 i 1 i 1 i 1 i'i 1 i 1 i 1 i 1 i'i 1 i 1 i'i"ii 1 i 1 i 1 w 1 "m 11 "ii"ii"ii"ii"ii!i Med-aServer_MediaServerfMRInterface aifaee, MmConnection serv, int med id, int room, MediaServerlnfo ainfo) - Conneetionfiface, serv) " id = medjd; Medium =-= info- >MediaType; UserDese = info- > UserDese; mgrjoήήjnfo = connjnfo = info— >Conn; void MediaServer::process_msgf) proceSS msg CARD8 type, opeode; CARD32 msgjeq, msgjen; MedServRequestClass am; enum msgjobjjtates statue; if (NW- >Read(header, header len) < header len #ifdβf DEKJG - " M #. end -»i*f cβrr < " Rβad Erτp : " < <C — F1LE — < < " " < < (int)__LINE__ < < endl; deactivate elff); return; - Prot- > interpret headerf header, type, opcode, msg seq, msg len); #ifdef DEBUG " - cerr < < "Received from Media Server: Len:" < < msg len < < " Seq:" < < msg seq < < " cerr.flush(); - - # endif < < endl; // Handling replies for this class is a bit funny Sinee the // messages of this class were sent on receipt of some other // messages, we have to take action on the original messages // rather than this message. // Search far matching opcode/seqjnσ in msgjist // Invoice action on that message and delete it msg list.resetf); while (msg l_st.nextfm))( if (m-~>msg codef) — opeode && m- >»g seq nof) ■— ββg seq) { ft (type — ERROR GEN_SERVER &&. m- >st»πuπant()){ (void)m- >stιmulantO- >error objf)- >ej_ctiαaf ERROR MR SERVER, TCARD32)m- >stιmulantf - >π-sg codef) m- >stlϊnuliht()- >msg seq_nof), -ERR SERV CONNJREJECT ; med. β erv.C med_serv.C ..frocest mβg m - >8Pβe , - Mtiθn(bUf ' -* * } // proeessjnsg mt MediaServer: . send_requestjnsg(MedServRequestClass amedserv_msg) Send_request_msg msg_list.insert_nextfmedserv_msg); retύrn(send(medserv jnsg)); ~ MediaServer:: " MediaServerf) MediaServer #ifdef DEBUG cout << "MediaServer " < < (int)Medium < < " Deleted\n"; eout.fluah(); Φ endif Ifaee- >RoomManagerf)- >MediaServerDied(id); I IJJU MJedJIiaISlelrlvlelrUMJgrII mIIeItIhIoId/smillll ////////////////////////////////// void MediaServerMgn-processfMmConnection serv) pro C CSS List of r_ppiitteerrffMMeeddiiaaS -erver -) el -istf -server list); MeάjaS seernver aobj; - cϋstjesetf); while fel st.nextfobj)){ if (obj— >conneetion() « serv)f obj- >precess msgf); garbage olleetf); return; } MediaServerMgr:: " MediaServerMgrf) MediaServerMgr MediaServer am; server list.resetf); while ' fserver i_st-next(m))f if ( f delete m; int MediaServerMgnnnitjnedia erverfRequestClaas astimulant, int room, Media m, String userjiesc, Listfint) part_list) List of piterfMediaServer) slistfserver list); MediaServer a med *■ (MediaServer a " ) NULL; MmConnection server; MediaServerlnfo ainfo; String machine; int port, dummy, len; ehar hoβt[HOST_NAME_LEN]; AssociateServer a~msg; int found =■ - 1, err; siist.resetf); while falistJ extfmed ...MedisS r- rM dummy — (med- >user desef) « user desc) ? 1 : 0; if (dummy -tk med- > mediumf) —= m " K if (Ifaee- >Ro πιManaferf)- ^>hServerPresentfroom, med- >ServerId())) returnf-ERR SERVER ALREADY ADDED); found a- med- >ServerId(); break; > ' (!med) return(-ERR_NO_RESOURCES); // send an AaaoeiateServer msg to the media server msg =» new AssociateServerfstimuiant, NULL, REQUEST GEN SERVER, GEN_ASSOCIATEjSERVER, next eqjiofj; 0, KULL, med, room7 part list, m7 user desc); ~ if (!msg) retumf- ERR_ND RESOURCES); if (med— >send request-n-sgTmsg) < 0) returaf-Efe_G ^INOT_.CONTACT_MEDIA_SERVER); retum(O); - - - - } MediaServer a MediaServerMgr:get_media erver(Media mitring userjiesc) get_media_server List of piterfMediaServer) slistfserver list); MedTa≤erver a med -> (MediaServer » NULL; int dummy; s list.resetf); while (alβt-nextfmed dummy « (med— >user_desc() =-» user desc) ? 1 : 0; if (dummy && med— > " medium() = χ * m) break; returnfmed); } MediaServer MediaServerMgr:get_media erverfint serverjd) getjnedia_server List of piterfMediaServer) slistfserver list); MediaServer a med a- (MediaServer «7 NULL; int dummy; slist .resetf); while (slιst.next(med))f if (med- >ServerId() == server id) med__8 β rv.C med_serv.C , break: ...itt H iujttrter } "^^ int MediaSe e ArMfgKr::-AAddddS^crrvvenrffRRceqqnueessttCCllaaasss aamsg, CARDS2 requester, int room id, Media media, Stπngέ user_dese, Listfint)* part_list) { int serv; // ADD SECURITY // if bad room, error. If server already in room, error. If cannot // contact server, error. if (.'Ifaee— >RoomManacerf)- >is valid room(room id)) return(-ERR_RAD_ROOM_IDj - return(init_.media_serverfmsg, roomjd, media, userjiesc, part list)); int M^diaServerMgr-DropServerf RequestClass amsg, CARD32 requester, int roomjd, Media media, Stringέ user j iesc) MediaServer aserv; MedServRequestClass areqj // ADD SECURITY if (llface— >RoomManaκerf)- >is valid roomfroom id)) retumf- ERR BAD ROOM IDJT - if ((serv -_ get media~serverf media. "* user desc)) — -. (MediaServera 1NULL1 r-ttιmf=-ERR " CANNOT CONTACT MEDIA SERVER); req -m new DisaseociateServerfmsg, NULL, REQUEST GEN SERVER, GENJMSΛSSOCIATE SERVER, next seqjuiO, 0, NULL, serv, roomjd, media, user αesch - if (!req) retumf- ERR_NO RESOURCES); if (serv— >sead request " mseϊreq) < 0) returaf-ERR CANNOT CONTACT MEDIA SERVER); retu fO); - - - void MediaSenrerMgr:DropServerfint roomjd, int serverjd) DropScrver MediaServer aser ; MedServRequestClass a req; Media media; String userjiesc; serv a= getjnedia_server(server_id); if (Iserv ) return; if (get j _senrer_infofserver_id, media, userjiesc) < 0) " return; " - req * new Di__a_»oeiateSeiTerf(ReQuestC_a_-sa)NULL, NULL, REQUEST_GEN_SERVER, GENJMSASSOCIATE ERVER, nextjeq_no() ( 0, NULL, serv, room id, media, " user desc); ~ " if (!req) return; - ~ (void) serv— >send equest_msgfreq); return; " ι ~ int MediaServerMgr-SnspendServerf RequestClass amsg, CARD32 requester, int roomjd, Media media, String& userjiesc) MediaServer aserv; MedServRequestClass areqj // ADD SECURITY if (llface— >RoomManagerf)- > is valid room(roomjd)) retumf- ERR BAD ROOSi IDJT « -,. , » if ((serv == get media~serverfmedia, user desc)) == (MediaServera )NULL) r«tumFERRT:ANNOT_CONT CT_MEDlA_SERVER); med__serv.C med_serv.C req - new GenSuspendServerfms , NULL, REQUEST GEN SERVER, ...D opServir GEN_SUSPEND_SERVER, next seq_nof), 0, " NULL, serv, room id, media, user desek ~ If (!req) retumf- ERR NO RESOURCES); if (serv— >send request msifreq) < 0) r β t β t β f-ERR CANNOT CONTACT MEDIA SERVER); returafO); " ' int MediaServerMgr .ResumeServerfRequestClaas amsg, CARD32 requester, int roomjd, Media media, String* user j iesc) MediaServer aserv MedServRequestClass areqj int MediaServerMfK-SetServerAceessListf RequestClass amsg, CARD32 requester, int room id, Media media, String* user desc, Listfint)* part Jist) MediaServer MedServRequestClass areq; void MediaServerMgrsendfint m, ehar adata, int len) send List of piterfMediaServer) slistfserver list); MedTaServer a med a. (MediaServer •) NULL; slist-resetf); while (sl-st.nextfmed)H if (med- >SenrerId() =— m) { med— >send(data en); return; . » ' } void MediaSen . erMgr:_send o_all ervers(char adata, int len) scnd_ tθ l_server List of piterfMediaServer) slistfserver list); Met_TaServer a med = (MediaServer «7 NULL; •~.send_ o_sU_ tτv*r* (void) med- >sendfdatajen); void MediaServerMgrπgarbagt_eoUeet() gαrbαge_ collect List of piterfMediaServer) clistfserver list); MediaServer aobj; ~ clist.resetf); while fcl-St.nertfobj)){ if (.obj- >_s_aiive()K delete" obj; clist.remove_ >rev(); int MediaServerMgr::get_serverjonnection(Media m, String* user desc, - - MediaServerConn* conn) - { List of piterfMediaServer) slistfserver list); MediaServer a med = (MediaServer »7 NULL; int dummy; slist.resetf); while (siιst.nextfmed)H dummy » (med— > user descf) »— user desc) ? 1 : 0; if (med— >mediumf) ■■> m ** dummy) retumf med— >get erver_eonnectιon(conn)); retumf— 1); int MediaServerMgr::get_manager_connection(Media m, String* user j iesc, "" "" MediaServerConn* conn) ~ { List of piterfMediaServer) slistfserver list); MediaServer a med -> (MediaServer *7 NULL; int dummy; slist.resetf); while (shst.nextfmed)){ dummy =■ (med— >user_desc() == user desc) ? 1 : 0; if (med— >mediumf) «■»■■ * m ** dummy) retumf med— >getjnaaagerjonnection(eonn)); retumf— 1); } void MediaSenrerMgr-set_manager_portfMedia m, String* user_desc, - int port) - { List of piterfMediaServer) slistfserver list); MediaServer a med = (MediaServer «7 NULL; int dummy; slist.resetf); while (shst iextfmed)){ dummy «■ (med— >user_descf) -_= user desc) ? 1 : 0; if fmed— >mediumf) «= m ** dummy) med— >setjnanager_Dort(port); slist.resetf); while (shst.nextfmed))f dummy = (med— >user_desc == user desc) ? 1 : 0; if (med— >medium() == m && dummy) retura(med— >Serverfd()); retum(— 1); } int MediaServerMgr:get_server_info(int server, Media* m, String* user j iesc) { List of piterfMediaServer) slistfserver list); -MedϋaServer med = (MediaServer 7 NULL; int dummy; slist.resetf); while (shst.next(med))f if (med— >ServerId() == server) f m = med— >medium(); userjiesc = med— >user desc(); returafO); ~ return(— 1); } MmConnection MediaServerMgr::ServerConnection(int server) ServerConne c tion { List of piterfMediaServer) siist(server list); MedTaServer a med = (MediaServer 7 NULL; slist.resetf); while (shst.next(med))f if (med— >SeryerId() == server) { return(med— > connect. on( II))I' } retura((MmConnection) NULL); 1 medaerv_mBg.C medserv_m8g.C # include <ifaee ι> # include <client-h> # include <ioβtream_h> # include <room-h> # include <med_servh> msgjobjjtates AddServer:action() actio int room id, participant, nbytes, poβ = 0; CARD32 " requester; Media media; String user j iesc; List(int) part list; int err, listjeh, resjen = len; # ifdef DEBUG cout < < "AddServer calledXn"; cout.flush(); # endif . (void Conv— >BufToCARD32fdata+pos, res len, nbytes, requester); poβ += nbytes; (voidjConv— >BufToCARD32(data+pos, resjen, nbytes, room id); poβ +== nbytes; media = (Media)data|poβ++j; ~ - if (Conv— >BufToString(data+poβ, res len, nbytes, user desc) < 0) retura(error- >e_action(ERROR_MR_SERVER, opcode, seq_no, ERR INCOMPLETE MSG)); poβ += nbytes; - _ - _ _ if (Conv- >BufToCARD32(data+poβ, res len, nbytes, list len) < 0) retura(e_rror- >e_act_on(ERROR_ " MR_SERVER, opcode, seq_.no, ERR INCOMPLETE_MSG)); poβ += nbytes; - _ - _ part list.resetf); for fint i — 0; i < list len; i++){ if (Conv- >BufToCARD32(data-(-poβ, res len, nbytes, participant) < 0) retumferror- >e_action(ERROR_MR_SERVER, opcode, seq_no, ERRjTNCOMPLETE_MSG)); pos += nbytes; - - — part Jist .insert jiextfparticipant); if ((err = MSMgr— >AddServer(this, requester, roomjd. media, user desc, part list)) < " 0) returnf error- >e_action(EHROR_MR_ ERVER, opcode, seq_no, -err)); retura(e_MSG_PENDING); } //AddServer::action - void REP_AddServer::r_action(MediaServerConn& conn) r_action int rep Jen, poβ = MSG_HEADER_LEN; rep buf.reservefconn.machine.length()- -9); rep_buf [poβ-M-f - INTERNET CONNECTION; Conv— >IntToSuf(cαnn.machme.length(), ((char » )rep_buf)+poβ); poβ +=' 4; strcpy(((ehar a)rep_buf)-t-poB, conn.machine); poβ -*-= "" conn.machine.length(); Conv— >IntToBuifcόnn.port, ((char a)repJbuf)+poβ); poβ += 4; rep Jen = len_in_CARD32(poβ-MSG_HEADER_LEN); fill " reply headSrftype, opcode, βeα noT rep len);- (vό d) Invoker- >send(rep_buf, MSG_HEADER_LEN+repJena4); } msg j objjtates DropServer::action() action int room id, participant, nbytes, pos = 0; CARD32 " requester; Media media; String userjiesc; medserv_msg.C medserv_msg.C int err, resjen " = len; ...action # if ef DEBUG cout < < "DropServer called\n"; cout.flush(); # endif oid)Conv- >BurroCARD32fdata+pos, res len, nbytes, requester); poβ +== nbytes; Void)Conv- >BufToCARD32fdata+poβ, reslen, nbytes, room id); poβ += nbytes; media = (Media)data{poβ++]; - ~ if (Conv- >BuiToStnng(data+poβ, res len, nbytes, user desc) < 0) retumferror- >e_action(ERROR MR SERVER, opcode, seq_no, ERR INCOMPLETE MSG)); poβ += nbytes; - - _ if ((err = MSMgr— >DropServerfthis, requester, roomjd, media, user desc)) < 0) retumferror- >e_action(ERROR_MR_SERVER, opcode, seq_no, -err)); return(e_MSG_PENDING); } //DropServer::action msg bjjtates SuspendServer::action() action int room id, participant, nbytes, pos = 0; CARD32 Tequester; Media media; String user j iesc; int err, resjen = len; # if def DEBUG cout < < "SuspendServer called\n"; cout.Ωushf); # endif (voidlConv— >BufToCARD32fdata+poβ, res len, nbytes, requester); poβ += nbytes; (void)Conv— >BufToCARD32(data+pos, resjen, nbytes, room id); poβ += nbytes; media = (Media)data{poβ++]; ~ - if (Conv— >BufToStnngfdata+poβ, res len, nbytes, user desc) < 0) retura(error- >e_action(ERROR_MR_SERVER, opcode, seq_no, ERR INCOMPLETE MSG)); pos - = nbytes; - ~ - ~ if ((err = MSMgr— >SuspendServer(this, requester, roomjd, media, user desc)) < 0) retura(error- >e_action(ERROR_MR_SERVER, opcode, seq_no, -err)); return(e_MSG PENDING); } //SuspendServer::act7on msgjbjjtates ResumeServer::action() action int room id, participant, nbytes, pos = 0; CARD32 " requester; Media media; String userjiesc; int err, resjen = len; # ifdef DEBUG cout < < "ResumeServer called\n" ; cout.Ωush(); # endif (void)Conv— >BufToCARD32fdata-(-pos, res len, nbytes, requester); poβ += nbytes; (void)Conv— >BufToCARD32(data-t-pos, resjen, nbytes, roomjd); pos += nbytes; media = (Media)data|poβ++]; if (Conv— >BufToStπng(data+pos, res len, nbytes, user desc) < 0) return(error- >e_action(ERROR_MR_SERVER, opcode, seq_no, ERR_INCOMPLETE_MSG)); pos += nbytes; ~ if ((err = MSMgr- >ResumeServerfthis, requester, roomjd, media, ~ user desc)) < 0) return(error- >e action(ERROR MR SERVER, opcode, seqjao, -err)); medserv_msg.C medserv_mag.C ...action returafe_MSG_PENDING); } //ResumeServer::action msg_objjtates SetServerAecessList::aetion() action int room id, participant, nbytes, pos = 0; CARD32 " requester; Media media; String user j iesc; Listfint) part list; int err, listje , resjen = len; # if def DEBUG cout < < "SetServerAccessList called\n"; cout.flush(); # endif fvoidlConv— >BufToCARD32fdata+pos, res len, nbytes, requester); poβ += nbytes; (void)Conv— >BufToCARD32(data- -pos, resjen, nbytes, room id); poβ += nbytes; media = (Media)dataJpoβ++]; - ~ if (Conv— >BufToStrmg(data+poβ, res len, nbytes, user desc) < 0) return(error- >e_action(ERROR_MR_SERVER, opcode, seq_no, ERRJNCOMPLETE MSG)); poβ += nbytes; - ~ ~ if (Conv- >BufToCARD32(data+pos, res len, nbytes, list len) < 0) return(error- >e_action(ERROR J RJSERVER, opcode, seq j io, ERRJNCOMPLETE MSG)); pos += nbytes; ~ ~ ~ part list.reset(); for fint i = 0; i < list len; i++)f if (Conv— >BufTόCARD32(data+pos, res len, nbytes, participant) < 0) retum(error- >e_action(ERROR_MR_SERVER, opcode, seq_no, ERR INCOMPLETE MSG)); pos += nbytes; - - - — - part_listinsert_next(participant); if ((err = MSMgr— >SetServerAccessL_st(this, requester, roomjd, media, user desc, part list ) < 0) returaferror— >e_action(EHROR_MRJ-iERVER, opcode, seq_no, — err)); retum(e_MSG_PENDING); } //SetServerAccessLis ' t::action msgjbjjtates ListServers::action() action int roomjd, participant, nbytes, pos = 0; CARD32 requester; int err, res len = len; List of_pfFύllMediaDesc) medjist; REP -istServers a reply; - # if def DEBUG cout < < "DropServer cailed\n"; cout.flushf); # endif (void)Conv— >BufToCARD32fdata+pos, res len, nbytes, requester); pos += nbytes; (void)Conv- >BufToCARD32(data+pos, resjen, nbytes, roomjd); pos += nbytes; if ((err = RMgr— >ListServers( requester, room id, medjist)) < 0) retumferror- >e_action(ERROR_MR_SERVER, opcode, seqjio, -err)); reply = new REP ListServers(NULL, REPLY MR SERVER, opcode, seqjio, 0, NULL, ϊhvoicer); if (.reply) { _, cout < < "Fatal Mem Alloc. Error: " < < _FILE_ < < " " < < __LINE_ < < endl; return(e_MSG_SERVICED); reply— >r_action(med_list); medserv_msg.C medserv_msg.C delete reply; ...action retura(e_MSG_PENDING); } //ListServers::action void REP_L-3tServers:s_-_ction(List_of >(Ful-MediaDesc)& med list) List_ fjp int rep len, poβ = MSG_HEADER_LEN; FullMedϊaDese *m; rep_buf.reserve(1000); // CHANGE LATER med_Iist.reset(); Conv- >IntToBuif med Iist.length(), ((char a)rep_buf)+poβ); poβ += 4; while (med list.next(m))f rep >uf[poβ++j = (ehar) m— >server; Conv- >IntToBuffm- >user desc.length(), ((char a)rep_buf)+poβ); poβ += 4; strcpy(((char a)rep_buf)+pos, m- >user desc); poβ += m- >user_desc.length(); - Conv— >IntToBuf(m- >machine.length(), ((char «)rep buf)+pos); pos += 4; strcpy(((ehar a)rep buf)+pos, m- > machine); poβ •+-= m— >macEine.ϊength(); Conv- > Int ToBuf(m- > port, ((char a )rep_buf)+poβ); poβ += 4; II rep_buf[poβ++[ = (ehar) m— > status; delete m; // since it was alloc 'd for this rep Jen = len_in_CARD32(poβ-MSG_HEADER LEN); fill ~reply_header(type, opcode, seqjio, rep len);- (void) Invoker- >send(rep_buf, M5G_HEΛDER_LEN+repJen 4); } msgjbjjtates GetServerInfo::action() action int roomjd, participant, nbytes, pos = 0; CARD32 requester; int err, resjen = len; Media media; String userjiesc; REP_GetServerInfo » reply; # ifdef DEBUG cout < < "GetServerlnfo called\n"; cout.flushO; # endif (void)Conv— >BuiToCARD32(data+pos, resjen, nbytes, requester); pos += nbytes; media = (Media)data!poe++j; if (Conv— >BufϊoStringfdata+poβ, res len, nbytes, user desc) < 0) retumf error- >e_aetion(ERROR_MR_SERVER, opcode, seq j io, ERR_INCOMPLETE_MSG)); pos += nbytes; - ~ ~ ~ // Get manager conn info MediaServerConn conn; if (MSMgr— >get manager _connection( edia, user desc, conn) < 0) retumferror- >e_action(ERROR_MR_SERVER, opcode, seqjio, ERR_NON_EXETENT)); reply = new REP GetServerlnfofNULL, REPLY_MR SERVER, opcode, seqjao, 0, NULL, InvokerJ; if (.reply) f cout < < "Fatal Mem Alloc. Error: " < < __FILE__ < < " " < < __LINE_ < < endl: retura(e_MSG_SERVICED); reply— >r action(conn); delete reply; medserv_msg.C medserv_msg.C ...action retumfe MSG_PENDING); ) //GetServerinio:_action void REP_GetServerInfo:3'j-Ction(MediaServerConn& conn) r action int rep Jen, pos = MSGJHEADER_LEN; rep buf.reservefeonn.maehine.length() -θ); repJ>uf(poβ++l = INTERNET CONNECTION; Conv— >IntToBuf(conn.machine.Iength(), ((char a )rep_buf )+poβ); poβ += 4; strcpyf((ehar β)rej> _buf)+poβ, conn.machine); pαβ += "* conn.machine.length(); Conv— >IntToBu_fcόnn.port, ((ehar β)rep_buf)+poβ); pαβ += 4; rep Jen = len_in_CARD32(poβ-MSG_HEADER_LEN); fill " reply headerftype, opcode, seq rioT rep len);~ (void) Invoker- >send(rep_buf, MSG_HEADER_LEN+repJena ); / ///////////////////////////////// // MedServRequest class methods /////////////////////////////////// AssociateServeπiAssoeiateServei RequestClass astimulant, ehar aheader, CARD8 msgjyp, CARD8 msgjode, int msg eq no, - int msgjen,- ehar amsg data, Connection ainvoker, int proόm, Listfint)* pEst, Media pmedia, String* puser_dese): MedServRequestClass(stimulant, header, msgjyp, msg ode,msg_seq_no, msgjen, msgjiata, mvoker, — proom, pmedia,~puser_desc) part list = plist; // sEould send part_list LATER common_build(); — void AssociateServer:-special_action(Block(char)& reply_data, ~ int rdatajen) { REP AddServer reply; MediaServerConn conn; int server_port; int server id; int err = -ERR_SERV_CONN_REJECT; server_port = Conv— >BufToInt(reply_data); // The Media Server would have returned the port number in which it // it is listening for connections from the Locai Media Agents. The // MR Server would know about the machine name of the Media Server // as it was able to connect to the Media Server. (void) MSMgr— >set_manager_port(media, userjiesc, server_port); server id = MSMgr— >get_server id(media, user desc); if (rdatajen == 4 &* (err = RMgr- > AddServer - (room, serverjd, media, userjiesc, part Jist)) >= 0 && stim msg)f — — ™" reply = new REPj ddServer(NULL, REPLY_MR_SERVER, - stim msg— >msg_cSc_e(), stim msg— >msgjeq_no(), 0, NULL, stimjhsg— >MsgSόurcef)); - (void) MSMgr— >get_managerjonnectiόn( media, user_desc, conn); reply— >r_action(conn); stim_msg- :" >Msgaource()— > serviced _msg( stim_msg); delete reply; ~ "" if (err < 0 && stim_msg)f medserv_msg.C medserv_msg.C (void) stimulantA- >error obj()- >e action(ERROR MR SERVER, ...r action (CARD32)rtϊmulant{)- " >msg_code(), ~ - fCARD32)stimulantf)- >m3g eq_no(), - err); stimjnsg— >MsgSourcef}- >servieed_msgfstTm_m3g); Disa-gociateServer: -DisassociateServerfRequestClass astimulant, char aheader, CARD8 msgjyp, CARD8 msgjode, int msgjseq no, - int msgjen,- char a msgjiata, Connection ainvoker, int proόm, Media pmedia, String* puserjiese): MedServRequestClassfstimuiant, header, msgjyp, msg ode,msg_seq_no, msgjen, msgjiata, invoker, — proόm, pmedia,- puserjiese) common_build(); void DisassociateServer:_speciaI_action(Block(ehar)* reply jiata, ~ int rdatajen) int serverjd, err; serverjd = MSMgr— >get_server_id(media, userjiesc); if ((er? = RMgr— >DropServerfroόm, server id, - media, user desc)) >= 0 &£ stim msg) (void) stim msg- >error_obj()- > success jeturnfREPLY MR SERVER, [CARD32)stimulantf)- >msg codef), ~ - (CARD32jstimulantf)- >msg-seqjιof)); if (err < 0 && stim msg)f (void) stimulantf)- > error obj()- >e_action(ERROR MR SERVER, (CARD32)stTmulantf )- > msg_code(), (CARD32)stimulantf)- >m3g seq_nof), -err); stim_msg— >MsgSource()— >seιviced jnsgfstTmjnsg); } GenSuspendServer::GenSuspendServerfRequestClass astimulant, ehar aheader, CARD8 msgjyp, CARD8 msgjode, int sg eq no, int msgjen,- char a msgjiata, Connection ainvoker, int proόm, Media pmedia. String* puserjiese): MedServRequestClassfstimuiant, header, msgjyp, msgjode,msgj<eq_no, msgjen, msgjiata, invoker, "" pro m, pmedia,~puser_desc) common_build(); void GenSuspendServer:_special_action(Block(ehar)* reply data, ~ int r atajen) { int serverjd, err; server id = MSMgr— >get server id(media, user desc); if ((err = RMgr— >Suspen " HServerfroom, serverjd, media, user desc)) >= 0 && stlm_msg) (void) stim msg- >error_obj()- >success_return(REPLY_MR SERVER, (CARD32)stimulant()- >msg codef), (CARD32)stimulant()- >msg-seq_nof)); stim_msg— >MsgSource()— >serviced_msgfstTm_msg); if (err < 0 ** stim msg)f (void) stimulaitO- >error obj()- >e action(ERROR MR SERVER, (CARD32fetrmulant -!> ms _code(), (CARD32)stimulant()- >msg_seq_no0, - err); medserv_msg.C medserv_msg.C stim_msg— >MsgSourcef)— >serviced_msg(stim_msg); ...τ_aetion GenResumeServer::GenResumeServer(RequestClass astimulant, ehar aheader, CARD8 msg typ, CARD8 msgjode, int msg eq no, - int msgjen,- char a msgjiata, Connection ainvoker, int proom, Media pmedia, String* puser j iese): MedServRequestClassfstimuiant, header, msgjyp, msgjode,msgjeq_no, msgjen, msgjiata, invoker, - proom, pmedia,~puser_desc) commonjbuildf); void GenResumeServer:_special_action(Block(char)* reply j data, - int " rdatajen) 'int serverjd, err; serverjd = MSMgr— >get_server id(media, user desc); if ((err = RMgr— >ResumeServerXroom, server J3, media, user desc)) >= 0 && stim_msg) (void) stim msg- > error obj()- > success returnfREPLY MR SERVER, (CARD32)itimulant - >msgjodef), (CARD32)stimulantf)- >msg eqjιoQ); stim_msg— >MsgSource()— >serviced_msg(stTm_msg); if (err < 0 *& stim msg){ (void) stimulant/)- > error obj()- >e action(ERROR MR SERVER, ~ fCARD32ystrmulantf)- " >msgjodef), fCARD32)stimulantf)— >msg eq_nof), —err); stim_msg— >MsgSourcef)— > serviced jnsgfstϊinjnsg); SetAccessList::SetAccessListfRequestClass astimulant, ehar aheader, CARD8 msgjyp, CARD8 msgjode, int msgjeqjio, int msgjen, char amsg data, Connection ainvoker, — int proom, Listfint)* pEst, Media pmedia, String* puserjiese): MedServRequestClass(stimulant, header, msgjyp, msg j ode,msg seq_no, msg len, msg j iata, invoker, proόm, pmedia, puserjiese] int p; part list = plist; req_bufreservef*βG_HEADERj^EN+8+plist.length()a4); Conv— >IntTαBuffroόm, ( (chair a)req_buf)+pos); poβ += 4; Conv- >IntT<_BuffplistJength(), ( char a)req_buf)+poβ); poβ += 4; while (plist iextfp)){ Conv— >IntToBuf(p, (fchar a)req_buf)+pos); poβ += 4; len = lenjn_CARD32(pαβ) < < 2; fill request " headerf); } void SetAcee3sList:_specialjtction(Block(char)* reply jiata, — Tint rdatajen) int serverjd, err; server id = MSMgr— >get_server id(media, user desc); if ((err = RMgr— >SetAccessList(room, serverJO " , media, user desc, part list)) >== 0 && stim msg){ (void) stim j nsg— terror obj(p- > success _return(REPLY_MR_SERVER, medserv_msg.C medserv_msg.C ...r action # define DUMMY CLDΞNT 1 # include <iface.h> # include < client.h > # include <iostream_h> # include <room_h> msg_objjtates CreateRoom::action() action int id; RoomAttrib rattrib; CARD32 owner; String roomjiame; if ((err = rout_ng_action()) < 0) retumferror- >e action(ERROR MR SERVER, opcode, seq no, -err)); else if (err > 0) ~ - - return(e_MSG_PENDING); voidJConv— >BufToCARD32(data+poβ, res len, nbytes, owner); poβ += nbytes; void)Conv— >BufToCARD32fdata-l-pos, resjen, nbytes, (int)rattrib); poβ += nbytes; if (Conv— >BufToStringfdata+pos, res len, nbytes, room name) < 0) retumferror- >e_action(ERROR_MR_SERVER, opcode, seqjo, -err)); # ifdef DUMP MSG cout <-< "REQUEST MR SERVER: CreateRoom/" < < seq j io < < "/" < < len < " < " Owner: " < < owner < < " Attrib: " < < (int)rattrib < < " Name: " < < room j iame < < endl; cout.fiushf); ~ # endif id = RMgr— >CreateRoomf owner, rattrib, room name); if (id < 0) return(error- >e_aetion(ERROR_MR_SERVER, opcode, seq j io, - id)); # if def DEBUG cout < < "NEW ID: " < < id < < endl; cout.flush(); # endif reply = new REP CreateRoom(NULL, REPLY MR SERVER, opcode, seq no, 0, NULL, Invoke!-); if (Ireply) f cout < < "Fatal Mem Alloc. Error: " < < _FILE < < " " < < _LINE__ < < endl; return(e_MSG_SERVICED); reply— >r action(id); delete reply; return(e_MSG_SERVICED); } //CreateRoom ::actiόh void REP_CreateRoom::r_action(int id) r_actiθn Conv- >IntToBuf(id, ((ehar a)rep_buf)+pos); pos += 4; rep len = 1; sen3 reply(); } msg obj states DestroyRoom::action() action { ' i ~nt roomjd; int requester, #ϊfdef DEBUG cout < < "DestroyRoom called\n"; cout.fiush(); # endif mr_msg.C mr__msg.C ...action if ((err = routing action()) < 0) retumf error- >e action(ERROR MR SERVER, opcode, seq no, -err)); else if (err > 0) - retura(e_MSG_PENDING); (void)Conv- >BufToCARD32(data+poβ, res len, nbytes, requester); poβ += nbytes; (void)Conv- >BufToCARD32(data+poβ, resjen, nbytes, roomjd); poβ += nbytes; # ifdef DUMPjMSG cout < < "REQUEST MR SERVER: DestroyRoom/" < < seq_no < < "/" < < leϊ < " < " Roomld: " < < roomjd < < endl; cout.fiush(); ~ # endif if ((err = RMgr— >DestroyRoom(requester, room id)) < 0) retumferror- >e action(ERROR MR SERVER, opcode, seq j io, -err)); retumferror- >success returnfREPLY MR SERVER, opcode, seqjio)); msg j obj j tates ListRooms::action() action { CARD32 requester; Listfint) room Jist; List(Stnng) name_list; # ifdef DEBUG cout < < "ListRooms called\n"; cout.flush(); # endif if ((err = routing_aetion()) < 0) retumferror- >e_action(ERROR_MR SERVER, opcode, seq j io, -err)); else if (err > 0) retura(e_MSG_PENDING); (void)Conv— >BufToCARD32(data -pos, resjen, nbytes, requester); poβ += nbytes; if ((err = RMgr— >ListRooms( requester, room list, name_list)) < 0) return(e-Tor- >e_action(ERROR_MR_SERVER, opcode, seq_no, - err)); reply = new REP_ListRooms(NULL, REPLY MR SERVER, opcode, seq_no, 0, NULL, Tnv l er); if (.reply) { cout < < "Fatal Mem Alloc. Error: " < < FILE < < " " < < LINE < < endl; return(e_MSG_SERVICED); ~~ — reply— >r action(roomJist, name_list); delete reply; — return(e_MSG_SERVICED); } / /ListRooms ::action ~ void REP_ListRooms:-r_action(List(int)& roomjist, ~ List(Stririg)& namejist) int id, listjen = room_list.length(); rep buf.reserve(4+list_lena4); if (ώtjen) { roomjist .resetQ ; name_list.resetQ; Conv- > Int ToBuffϋst Jen, ((char a)rep_buf)+pos); pos += 4; # ifdef DEBUG cout < < "RoomList Len: " < < list len < < " .List "; cout.fiush(); # endif while (roomJist.next(id)){ String name; m-_'__msg.C mr_msg.C name list.nextfname); ...action Conv- >IntToBuffid, ((ehar »jrtp buf)+poβ); poβ += 4; Conv- >IntToBuffname.length(), ((char a)rep buf)+poβ); pos += 4; strcpyf f (chare )rep_buf+poβ), name); poβ += name.iength(); # if def DEBUG cout < < < < id < < # endif } } rep len = len_in_CARD32(pos-MSG_HEADER_LEN); sencTjeplyf); - "* msgjobjjtates ShowRoomStatus::action() action int room id; CARD32 " requester; RoomStatus stat; RoomLockStatus lock stat; # if def DEBUG cout < < "ShowRoomStatus called\n"; cout.flush(); # endif if ((err = routing action()) < 0) retum(error- >e action(ERROR MR SERVER, opcode, seq no, -err)h elee if (err > 0) " " " retum(e_MSG_PENDING); (void)Conv- >Buπ.oCARD32fdata+poβ, res len, nbytes, requester); poβ += nbytes; fvoidjConv- >BuiToCARD32(data+pos, resjen, nbytes, roomjd); pos +=± nbytes; if ((err = RMgr— >ShowRoomStatusfrequester, room id, stat, lock stat)) < 0) retumferror- >e_action(ERROR_MR_SERVER, opcode, seqjao, -err)); reply <___ new REP ShowRoomStatus(NULL, REPLY MR SERVER, opcode, seq j io, 0, NULL, Invoker); if (.reply) { cout < < "Fatal Mem Alloc. Error: " < < _FELE < < " " < < __LINE < < endl; return(e_MSG_SERVICED); reply— >r action(stat, lock tat); delete reply; return(e MSG_SERVICED); } //ShowRoomStatus::action void REP ShowRoomStatus::r_action(RoomStatus stat, RoomLockStatus lockjtat) r action rep buf pos++ = (char)stat; repj)uf poβ++ = (ehar)lockjtat; # ifdef DEBUG „ cout < < "RoomStatus: " < < (int) stat < < " LockStat: " < < (int)lock stat < < endl; cout.flu # endif rep len = 1; sen " replyf); } msg_obj tates ShowRoomAttributes::action() action { int room id; CARD32 " requester; RoomAttrib attrib; mr_msg.C mr tnsg.C # ifdef DEBUG Mton cout < < "ShowRoomAttributes called\n"; cout.fiush(); # endif if ((err = routing action()) < 0) retumferror- >e action(ERROR MR SERVER, opcode, seq_no, -err)); else if (err > 0) - . - - retura(e_MSG_PENDING); (vold)Conv- >Bu-ToCARD32fdata+poβ, res len, nbytes, requester); poβ += nbytes; (void)Conv— >Bu-ToCARD32fdata+poβ, resjen, nbytes, roomjd); poβ += nbytes; if ((err = RMgr— >ShowRoomAttributes( requester, room id, attrib)) < 0) retumferror- >e_action(ERROR_MR_SERVER, opcode, seq j ao, -err)); reply = new REP ShowRoomAttributesfNULL, REPLY MR SERVER, opcode, sea no, 0, NULL, Invoker); " - r -_ if (.reply) { cout < < "Fatal Mem Alloc. Error: " < < FILE < < " " < < LINE < < endl; retura(e_MSG_SERVICED); ~ " reply— >r action(attrib); delete reply; return(e_MSG_SERVICED); } //ShowRoomAttributes::action void REP_ShowRoomAttribute3::r_action(RoomAttrib attrib) r_actiθn rep buf[pos-(-+] = (char) attrib; rep~len = 1; # if def DEBUG cout < < "RoomAttributes: " < < (int) attrib < < endl; cout.flush(); # endif rep len = 1; sen3_reply(); msg j objjtates AlterRoomAttributes::action() action int roomjd; CARD32 requester; RoomAttrib attrib; # ifdef DEBUG cout < < "AlterRoomAttributes called\n"; cout.fiush(); # endif ERVER, opcode, seq no, - err)); (void)Conv— >BufToCARD32 data+pos, res len, nbytes, requester); poβ += nbytes; (voidlConv— >BufToCARD32(data+pos, resjen, nbytes, room id); poβ += nbytes; (void) Conv- >BufToCARD32(data+pos, resjen, nbytes, (intjattrib); poβ += nbytes; if ((err = RMgr— >AlterRoomAttributes(requester. room id, attrib)) < 0) returπferror- >e_action(ERROR MR SERVER, opcode, seqjao, -err)); return(error— >success_ urn(REPLY_MR_SERVER, opcode, seq_no)); } //AJterRoomAttributes-action " ~ "" msg_obj_states LockRoom::actionf) action int room id, nbytes, pos = 0; CARD32 Tequester; mr_msg.C mijmsg.C int err, resjen = len; ...action # if def DEBUG cout < < "LoekRoom caliedXn"; cout.flush(); # endif if ((err = routing aetion()) < 0) retumferror- >e_action(ERROR_MR SERVER, opcode, seq no, -err)); else if (err > 0) - return(e_MSG_PENDING); ( void)Conv- >BufToCARD32(data+pos, res len, nbytes, requester); poβ += nbytes; (void)Conv— >BufToCARD32(data+pos, resjen, nbytes, roomjd); poβ += nbytes; if ((err = RMgr— >LockRoom( requester, room id)) < 0) retu ferror- >e action(ERROR MR SERVER, opcode, seq no, -err)); r«tu^error- >succeas_retura(R_EPLY_MR_SERVER, opcode, seq j io)); } //LockRoom::action ~ msgj-bjjtates UnlockRoom::actionf) action int room id; CARD32 " requester; # if def DEBUG cout < < "UnlockRoom called\n"; cout.fiush(); # endif if ((err = routing action()) < 0) return( error- >e_action(ERROR MRJSERVER, opcode, seq j io, -err)); else if (err > 0) " return(e_MSG_PENDING); fvoid Conv— >BufToCARD32fdata -pos, res len, nbytes, requester); poβ += nbytes; (void)Conv— >BufToCARD32(data-t-pos, resjen, nbytes, roomjd); poβ += nbytes; if ((err = RMgr— > UnlockRoomfreouester, room id)) < 0) returnferror- >e action(ERRθR MR SERVER, opcode, seq no, -err)); return(error- > success jeturn(REPLY_MR_SERVER, opcode, seq j io)); } //UnlockRoom::action - - msg j obj j tates ShowAssociatedRoom::action() action { int meeting id. roomjd; CARD32 requester; #ifdef DEBUG cout < < "ShowAssociatedRoom ealled\n"; cout.fiush(); # endif if ((err = routing_action()) < 0) retumferror- >e action(ERROR MR SERVER, opcode, seqjio, -err)); else if (err > 0) - ~ " retura(e_MSG_PENDING); (voidlConv- >BufToCARD32 data+pos, res len, nbytes, requester); poβ += nbytes; (void)Conv- >BufToCARD32fdata+pos, resjen, nbytes, meetingjd); poβ += nbytes; if ((err = RMgr— >ShowAssociatedRoom(requester, meetingjd, room id)) < 0) retumferror- >e_action(ERROR_MR_SERVER, opcode, stqju , -err)); reply = new REP ShowAssociatedRoomfNULL, REPLY_MR SERVER, opcode, seqjio, 0, NULL, Invoker); if (Ireply) { cout < < "Fatal Mem Alloc. Error: " < < FILE < < " " < < _LINE_ < < endl; return(e MSG SERVICED); ~ " — } //ShowA-uocιatedRoόm::action void REP ShowAssoeiatedRoom::r action(int room id) r action { # if def DEBUG cout < < "Roomld: " < < roomjd < < endl; cout.fiush(); # endif ~ Conv- >IntToBuf(roomjd, ((char a)rep_buf)+poβ); poβ += 4; rep len = 1; — — sen3_replyf); msgjobjjtates ShowAssociatedMeeting::action() action { int meetingjd, room id; CARD32 requester; # if def DEBUG cout < < "ShowAssociatedMeeting called\n"; cout.0ush(); # endif opcode, seq j ao, -err)); ( void)Cbnv— >BufToCARD32 data+poβ, res len, nbytes, requester); poβ +=* nbytes; (void)Conv— >BufToCARD32(data+poβ, resjen, nbytes, roomjd); poβ += nbytesp- if ((err = RMer— >ShowAssociatedMeeting(requester, room id, meeting id)) < 0) return(error- >e_action(ERROR_MR_SERVER, opcode, seq j no, -err)); reply = new REP ShowAssociatedMeetingfNULL, REPLY MR SERVER, opcode, seqjio, 0, NULL, Invoker); - - if (.reply) f cout < < "Fatal Mem Alloc. Error: " < < FILE < < < < LINE < < endl; return(e_MSG_SERVICED); reply— >r action( meetingjd); delete reply; ~ r action msg_obj tates CreateMeeting::action() action { int id; MeetingAttrib matt rib; CARD32 owner, roomjd; if ((err = routing_action()) < 0) return(error- >e_action(ERROR_MR_SERVER, opcode, seq_no, -err)); mr_msg.C mr_msg.C elee if (err > 0) wtioB retura(e_MSG_PENDING); oid)Conv- >BulToCARD32(data+pos, res len, nbytes, owner); poβ += nbytes; oidlConv- >Bu_ToCARD32(data+pcβ, reslen, nbytes, roomjd); poβ += nbytes; void)Conv- >BufToCARD32(data+pos, resjen, nbytes, (int)mattrib); poβ -t-= nbytes; # ifdef DUMP MSG cout < "" < "REQUEST_MR SERVER: CreateMeeting/" < < seq j io < < "/" < < len < " < " Owner: " < < owner < < endl; cout.Ωush(); # endif id = RMgr- >CreateMeeting(owner, room id, mattrib); if (id < 0) return(error- >e action(ERROR_MR_SERVER, opcode, seq_no, -id)); # if def DEBUG .cout < < "NEW ID: " < < id < < endl; cout.flush(); # endif reply = new REP CreateMeetingfNULL, REPLY MR SERVER, opcode, seq no, 0, NULL, Invόker if (ireply) f cout < < "Fatal Mem Alloc. Error: " < < FILE < < " " < < LINE < < endl; return(e_MSG_SERVICED); reply— >r action(id); delete reply; return(e_MSG ERVICED); } //CreateMeeting::actTon void REP_CreateMeeting::r_action(int id) r_actiθn Conv— >IntToBuifid, ((char «)rep_buf)+pos); pos += 4; rep len = 1; ~ " sen3_reply(); msg_obj_states DestroyMeeting::action() action int meetingjd; int requester; # if def DEBUG cout < < "DestroyMeeting cal_ed\n"; cout.flush(); # endif if ((err = routing action()) < 0) retumferror- >e action(ERROR_MR SERVER, opcode, seq_no, -err)); else if (err > 0) returafe_MSG_PENDING); (void)Conv- >BufToCARD32(data+pos, res len, nbytes, requester); poβ += nbytes; (void)Conv— >BufToCARD32(data+pos, resjen, nbytes, meetingjd); pos += nbytes; # ifdef DUMP MSG cout < "" < "REQUEST_MR SERVER: DestroyMeeting/" < < seqjio < < "/" < < len < " < " Meetingld: " < < meetingjd < < endl; cout.flush(); - # endif if ((err = R FlMMggrr—— >>DDeessttrrooyyMMeeeettiinnggf( rreeqquueesstteerr,, mmeeeettiinngg ^ iidd)))) << 00)) retu ιrrnnf(error- >e action( 'ERRO ""R * MR - S » E——R •» V > -E > R -T- opcode, seq no, -err)); return(error r-- >success return(REPLY MR SERVER, opcode, seqjio)); mr_msg.C mr_msg.C ...action msgjobjjstates ListMeetings_.action() action CARD32 requester; Listfint) meetingjist; # if def DEBUG cout < < "ListMeetings calledXn"; cout.flushO; # endif if ((err = routing_action()) < 0) retumferror- >e actionfERROR MR SERVER, opcode, seq_no, -err)); elae if (err > 0) - - retura(e_MSG_PENDING); (void)Conv— >BufToCARD32(data+pos, resjen, nbytes, requester); pαβ += nbytes; if ((err = RMgr— >ListMeetings(requester, meeting list)) < 0) retumferror- >e_action(ERROR_MR_SERVER, opeode, seqjio, -err)); reply = new REP ListMeettngs(NULL, REPLY MR SERVER, opcode, seq no, 0, NULL, Invoker); if (.reply) { cout < < "Fatal Mem Alloc. Error: " < < FILE < < " " < < LINE < < endl; return(e_MSG_SERVICED); — — reply— >r action(meetingjist); delete reply; - returafe_MSG_SERVICED); } / ListMeetingsT:action void REP_ListMeetings::r_action(List(int)* meetingjist) List int id, listjen = meetingjist.length(); rep buf.reservef4+list len«4); if (list Jen) ( meetingjist.resetf); Conv— >IntToBufllist len, ((char a)rep buf)+pos); poβ += 4; # ifdef DEBUG cout < < "MeetingList Len: " < < list len < < " list "; cout.flushO; # endif while (meeting list.next(id))f Conv- >IntToBuffid, ((char a)rep buf)+pos); poβ += 4; # if def DEBUG cout < < " " < < id < < " "; # endif } rep len = len_in_CARD32(poβ-MSG_HEADER_LEN); sen3_reply(); — — ~ msg_obj tates ShowMeetingStatus::action() action int roomjd, meeting id, owner; CARD32 requester; List(Participantlnfo) info; MeetingStatus status; # ifdef DEBUG cout < < "ShowMeetingStatus called\n"; cout.flushO; # endif if ((err = routing_action()) < 0) mr_msg.C mr_msg.C retumferror- >e action(ERROR MR SERVER, opcode, seq no, -err)); ...action else if (err > 0) ~ retura(e_MSG_PENDING); void)Conv- >BufToCARD32(data+poβ, res len, nbytes, requester); poβ += nbytes; void)Conv— >BufToCARD32(data+pos, resjen, nbytes, meeting id); pos += nbytes; if ((err = RMgr— >ShowMeetingStatusf requester, meeting id, info, room id, owner, status)) < 0V{ ~ retumferror- >e_action(ERROR_MR_SERVER, opcode, seq j io, -err)); reply = new REP ShowMeetingStatus NULL, REPLY MR SERVER, opcode, seq no, 0, NULL, Invoker); " if (Ireply) { cout < < "Fatal Mem Alloc. Error: " < < FILE < < " " < < LINE < < endl; return(e_MSG_SERVICED); ~ reply— >r action(info, roomjd, owner, status); delete reply; ~ retum(e MSG_SERVICED); } //ShowMeeting5tatus::action void REP_ShowMeetingStatus::r_action(List(ParticipantInfo)& info, ~ - int roomjd, int owner, MeetingStatus status) Participantlnfo node; FuUMediaDesc am; List of_p(FullMediaDesc) med_iist; int ist Jen = info.length(); ~ # if def DEBUG # endif rep buf.reservef9+list lena(8+MAX_MEDIA_TYPES)); rep_buf(poβ+-(-f = (enar) status; ~ Coήv- >IntToBuf( roomjd. ((ehar » )rep_buf)+pos); poβ += 4; Conv- >IntToBuflowneF, ((char a)rep_buf)+pos); pos += 4; Conv- >IntToBuf(list len, ((char a)rep bufH-pos); poβ += 4; # if def DEBUG cout < < "infolist len: " < < list len < < " :List "; # endif msg j obj j tates ShowMeetRoomStatus::action() action int room id, meeting id, owner; CARD32 " requester; List(Participantlnfo) info; MeetingStatus status; mr_msg.C mr_msg.C ...action # if def DEBUG cout < < "ShowMeetRoomStatus called\n"; cout.flushO; # endif if ((err = routing action()) < 0) retumferror- >e_action(ERROR_MR_SERVER, opcode, seq j io, -err)); else if (err > 0) "" - - retura(e_MSG_PENDING); fvoidlConv— >BufToCARD32 data+pos, res len, nbytes, requester); poβ +== nbytes; (voidjConv— >BufToCARD32(data+pos, resjen, nbytes, roomjd); poβ += nbytes; if ((err = RMgr— >ShowMeetRoomS tat us( requester, roomjd, info, meeting id, owner, status)) < 0){ ~ * retumferror- >e_action(ERROR_MR_SERVER, opcode, seq_no, -err)); reply = new REP ShowMeetRoomStatusfNULL, REPLY MR SERVER, opcode, ata no, 0, NULL, Invoker); - - ι_ » . if (.reply) { cout < < "Fatal Mem Alloc. Error: " < < FILE < < " " < < LINE < < endl; retura(e_MSG_SERVICED); ~ " ~ ~ reply— >r action(info, meetingjd, owner, status); delete reply; returnfe MSG_SERVICED); } //ShowMeeting5tatus::action void REP_ShowMeetRoomStatus::r_action(List(ParticipantInfo)& info, ~ ~ int meetingjd, int owner, MeetingStatus status) Participantlnfo node; FulIMediaDesc am; List of_p(FullMediaDesc) med_list; int " Bst_len = info.length(); - # ifdef DEBUG # endif rep buf.reserve(9+list lena(8+MAX_MEDIA_TYPES)); rep~buf jpoβ++f = (enar) status; - Conv— >IntToBuf( meeting id, ((char a)rep_buf)+poβ); pos += 4; Conv— >IntToBuflowner, (fchar a)rep buf)+poβ); poβ += 4; Conv- >IntToBuf(list len, ((char a)rep buf)+pos); pos += 4; #ifdef DEBUG cout < < "infolist len: " < < list len < < " list "; # endif } mr_msg.C mr_msg.C ...action msg_obj tates ShowMeetingAttributes::action() action int meeting id; CARD32 requester; MeetingAttrib attrib; # if def DEBUG cout < < "ShowMeetingAttributes called\n"; cout.flush(); # endif if ((err = routing action()) < 0) return(error- >e action(ERROR MR SERVER, opcode, seq no, -err)); else if (err > 0) ~ ~ return(e_MSG_PENDING); (voidlConv— >BufToCARD32(data+pos, res len, nbytes, requester); poβ += nbytes; fvoid)Conv- >Bu_ToCARD32(dats-t-pos, resjen, nbytes, meeting j d); poβ += nbytes; if ((err = RMgr- >ShowMeetinκAttributes(requester, meeting id, attrib)) < 0) retumferror- >e_action(E2UlOR_MR_SERVER, opcode, seq j io, -err)); reply = new REP ShowMeetingAttributes(NULL. REPLY MR SERVER, opcode, seq no, 0, NULL, Invoker); - " if (Sreply) { cout < < "Fatal Mem Alloc. Error: " < < FILE < < " " < < LINE < < endl; return(e_MSG_SERVICED); — — reply- >r action(attrib); delete reply; return(e_MSG SERVICED); } //ShowMeetingAttriSutes::action void REP_ShowMeetingAttributes::r_action(MeetingAttrib r_actiθn endl; cout.flushO; msg j obj j tates AlterMeetingAttributes::action() action int meeting id; CARD32 requester; MeetingAttrib attrib; # ifdef DEBUG cout < < "AlterMeetingAttributes calied\n"; cout.flush(); # endif if ((err = routing_action()) < 0) retumferror- >e action(ERROR MR SERVER, opcode, seqjio, -err)); else if (err > 0) retum(e_MSG_PENDING); (void)Conv— >BufToCARD32(data+pos, res len, nbytes, requester); poβ += nbytes; (void)Conv- >BufToCARD32(data+pos, res~len, nbytes, meeting id): pos += nbytes; (void) Conv— >BufToCARD32(data+pos, resjen, nbytes, (int)attrib); poβ += nbytes; if ((err = RMgr— >AlterMeetingAttributes(requester. meeting id, attrib)) < 0) returnferror- >e_action(ERROR MR SERVER, opcode, seqjao, -err)); return(error— > success return(REPLY MR_SERVER, opcode, seqjio)); mr_msg.C mr_msg.C } //AlterMeetingAttributes::action ...action msgjobjjtates AddParticipant:_action() action { int meeting id; CARD32 requester; int participant; # ifdef DEBUG cout < < "AddParticipant ealled\n"; cout.ilush(); # endif if ((err = routing_action()) < 0) return(eιτor- >e_action(ERROR_MR_SERVER, opcode, seq_no, -err)); else if (err > 0) - return(e_MSG_PENDING); fvoidlConv— >Bu_ToCARD32fdata+pos, res len, nbytes, requester); poβ += nbytes; (voidlConv— >BufToCARD32 ( data+pos, res~len, nbytes, meeting id); pos += nbytes; (void)Conv— >BufToCARD32fdata+pos, resjen, nbytes, participant); poβ += nbytes; if ((err - RMgr— >AddParticipant(requester, meeting id, participant)) < 0) retumferror- >e action(ERROR MR SERVER^ opcode, seq no, -err)); retumferror- > success _return(REPLY_MR_SERVER, opcode, seq j io)); } //AddParticipant::action - msgjobjjtates DropParticipant::action() action { int meeting id; CARD32 requester; int participant; # if def DEBUG cout < < "DropParticipant calledVn"; cout.flushO; # endif if ((err = routing action()) < 0) return( error- >e action(ERROR MR SERVER, opcode, seq no, - err)); else if (err > 0) retura(e_MSG_PENDING); (void)Conv— >BufToCARD32fdata+pos, res len, nbytes, requester); poβ += nbytes; (voidlConv— >BufToCARD32(data+ pos, res~len, nbytes, meeting j d); pos += nbytes; (void)Conv— >BufToCARD32(data+pos, resjen, nbytes, participant); poβ += nbytes; if ((err = RMgr— >DropParticipant(requester. meeting id, participant)) < 0) return(error- >e action(ERROR MR SERVER7 opcode, seq no, - err)); retumferror— >success_return(REPLY_MR_SERVER, opcode, seq_no)); } //DropParticφant::action * ~ msg j obj tates SuspendMeeting::actionf) action { int meetingjd; CARD32 requester; # if def DEBUG cout < < "SuspendMeeting called\n"; cout.flush(); # endif if ((err = routing action()) < 0) return(error- >e action(ERROR MR SERVER, opcode, seqjio, - err)); elae if (err > 0) retura(e_MSG_PENDING); (void)Conv- >Bu_ToCARD32(data+pos, res len, nbytes, requester); pos += nbytes; (void)Conv- >BufToCARD32(data-t-pos, resjen, nbytes, meetingjd); pos += nbytes; if ((err = RMgr- > SuspendMeetingf requester, meetingjd)) < 0) mr_msg.C mr_msg.C return(error- >e_action(ERROR MR SERVER, opcode, seo no, -err)); ...action retumferror— >successjeturn(REPLY_MR SERVER, opcode, seq j io)); } //SuspendMeeting::action ~ ~ ~ msg_obj_states ResumeMeeting::actionf) action int meeting id; CARD32 requester; #ifdef DEBUG cout < < "ResumeMeeting called\n"; cout.flushO; # endif if ((err = routing_action()) < 0) return(error- >e_action(ERROR_MR SERVER, opcode, seq_ no, -err)); else if (err > 0) " return(e_MSG_PENDING); (voidlConv— >BufToCARD32(data+poβ, res len, nbytes, requester); pos += nbytes; (void)Conv— >BuiToCARD32(data+poβ, resjen, nbytes, meeting j d); poβ += nbytes; if ((err = RMgr— >ResumeMeeting(requester, meeting id)) < 0) retu ferror- >e_action(ERROR MR SERVERT opcode, seq j io, -err)); retumferror— > success jeturn(REPLY_MR_SERVER, opcode, seq_no)); } //ResumeMeeting::action - msg_obj_states LeaveMeeting::action() action int meeting id; ; # if def DEBUG cout < < "LeaveMeeting called\n"; cout.flush(); # endif if ((err = routing action()) < 0) return( error- >e_action(ERROR_MR_SERVER, opcode, seq_no, -err)); else if (err > 0) return(e j MSGJPENDING); (void)Conv— >BufToCARD32fdata+pos, res len, nbytes, requester); pos += nbytes; (voidlConv— >BufToCARD32(data+pos, res~len, nbytes, meeting j d); pos -*-= nbytes; (void)Conv— >BufToCARD32(data-t-pos, resjen, nbytes, participant); pos += nbytes; if ((err = RMgr— >LeaveMeeting(requester, meeting id, med list)) < 0) returnferror- >e_action(ERROR_MR_SERVER, opcode, seq_.no, -err)); retu ferror- >success_return(REPLY_MR_SERVER, opcode, seq j ao)); } //LeaveMeeting::action ) action # if def DEBUG cout < < "ReenterMeeting called\n"; cout.flushO; # endif if ((err = routing_action()) < 0) return(error— >e_action(ERROR_MR_SERVER, opcode, seqjio, - err)); mr_msg.C mr_msg.C else if (err > 0) ution return(e_MSG_PENDING); (void Conv- >BufToCARD32(data+poβ, res len, nbytes, requester); poβ +_= nbytes; ( voidlConv- >BufToCARD32(data+poβ, reslen, nbytes, meetingjd); poβ += nbytes; (void)Conv- >BufToCARD32 ( data+poβ, resjen, nbytes, participant); pαβ += nbytes; if ((err = RMgr— >ReenterMeetingfrequester, meeting id, med list)) < 0) retumferror- >e_action(ERROR_MR_SERVERT opcode7 seqjio, -err)); med list.resetf); while (medjιst.next(m) && m) delete m; returnferroF- >success_return(REPLY MR SERVER, opcode, seq j io)); } //ReenterMeeting::action - ~ # if def DEBUG eout < < " LeavcMceting callei n" ; cout.fluahf); # endif if ((err = routing αetionβ) < 0) retumferror- >e αction(ERROR_MR SERVER, opeode, seq no, -err)); else if (err > 0) ~ ~ ~ retumfc iSGJΕNDING); (void)Conv->BufToCARDSS(dαtα+pos, resjen, nbytes, requester); poβ += nbytes; (void)Conv->BufToCARDSS(dαtα-hpos, resjen, nbytes, meeting id); pos +— nbytes; (voii)Conv- >BufToCARD32(dαtα+poβ, resjen, nbytes, listjenj~ pos -h= nbytes; med list.resetf); for Jint i = 0; i < list len; i++) { m = new MediaDesc; if H { m->βerver = (Mediα)dαtα(pos++j; if (Conv- >BufToStringfdαtα+pos, resjen, nbytes, m-> user j iesc) < 0) ~ retumferror- >c action) 'ERROR MR SERVER, opcode, seqjno, ~-ERR_INCOMPLETE_MSG)); medjist.insert_next(m); — else retumferror- >e actionfERROR MR SERVER, opeode, leg no, -ERR NO RESOURCES)); } " ' if ((err = RMgτ->LeaveMeeting(requester, meeting id, med list)) < 0) retumferror- >e_aetion(ERROR_MRJ5ERVER, opeode, seq j no, -err)); med list.resetf); while (medjist.nextfm) &8 m) delete m; returnferror " ->8*eeeββ_returnfREPLY_MR_SERVER, opeode, eeq_no)); } //LcavcMtcting:: ction ~ ~ ~ msg j obf j ttates ReenterMeeting::aetionf) int meeting id; CARDSS requester; int list ten; List oF fMcdiaDcsc) medjist; MciiaDcse *m; mrjmβg.C mr_msg.C φ if def DEBUG eout < < "RecnterMccting caUea n"; eou flushf); Φ endif if ((err = routing action()) < 0) retumferror- >e actionfERROR MR SERVER, opcode, seq no, -err)); else if (err > 0) ~ retum(e_MSG_PENDlNG); if ((err = RMgr- >RcenterMccting( requester, meeting id, med list)) < 0) retumferror->e_actionfERROR_MR_SERVER pcode,~seq_no, -err)); med list.resetf); while (med lisLnextfm) 88 ml delete m; retumferror- >sueeess_rctum(REPLY_MR_SERVER, opeode, seqjno)); } //ReenterMeeting::aetion ~ ~ ~ aaaaaasaaaa/ ...action msg_ob)' j ιtates NameServerMβg::action() action int err; # ifdef DEBUG cout < < "Routing NameServerMsg\n"; cout.flush(); # endif if ((err = for NameServerf)) < 0) retu f error- >e action(ERROR_MR SERVER, opcode, seq_no, -err)); retum(e MSG PENDING); } " " msg.C msg.C # define DEBUG 1 # define DUMMY LIENT 1 # include <i ace.h> # include <server_reg_h> # include <obj_man _ι> # include < client.h > # include <iostream_h> Φ include <roomh> Block(char) GenericReplyClass::rep_buf(INIT MAX REPLYSEE); List_of_pimplement(Message) ~ ~ List_θfjpimplement Message::Message(ehar *m_header, CARDS msg typ, CARD8 msg code, int msg seq_no, int msgjen, char » msg j iata, Connection « invoke " ?) - if (m header) f ~ for (int i = 0; i < MSG HEADER_LEN; i++) header [if = m_header[ij; - type = msgjyp; opcode = msgjode; seqjio = msg seq no; len = msg len; data = msgjfatafTnvoker = invoker; RMgr = Invoker— >RoomManagerf); Conv = Invoker— >ConvQ; MSMgr = Invoker- >MRIface()- >MediaServerManager(); pos = 0; void Message:3et_msg eq_nofint s) set_msg_seq_J~0 seq_no = s; Conv- >IntToBuf(seqj_o, header+MSG_HOFFSET_SEQ); int Message::len_in_CARD32(int len_in_bytes) len_in_CARDS2 int rep eil; rep eil = len in_bytes%4; retύrn((len_in_byt es /^) + (repjeil ? 1 : 0)); int Message::for_NameServer() fθr_NameServer if (Invoker- >MRIfacef)- >ReqNMManager ~ >send to NMfthis) < 0) return(-ERR_MR_SERVER_DOWN); int Message::for_some_other_MR(int MRJd) fθT Sθme_θther_MR String machine; int port; /cout < < "ID: " < < MR id < < endl; if (Invoker- >MRIfacef)- >ServReg()- >in_myjange(MR_id)) return(O); - "" - if (Invoker- >MRIface()- >ServReg()- >server_for_id(MRJd, machine, port) == 0)f cerr < < "Cannot find Server in Registry\n"; retum(- ERR_MR_SERVER_DOWN); # if def DEBUG cout < < "Mach: " < < machine < < "::" < < port < < endl; cout.flush(); # endif if (Invoker- >MRIface()- >ReqMRManager{)- >send_to_MR msg.C msg.C (machine, port, this) < 0) t oτ βome ether MR return(-ERR_MR SERVER_DOWN); " " retu f 1); ~ - - msgjobjjtates Diseonnect::action() action #ifdef DEBUG cout < < "Disconnect received\n"; cout.flushO; # endif Invoker— > deactivate selff): retum(e_MSG_SERVICED); void GenericReplyClass::fιll reply header(CARD8 msg type, CARDS msg opcode, CARD32 msgjeqjio, CARD32 msgjen) rep buflMSG HOFFSET TYPE1 = msg type; rep ' buflMSGTJOFFSETTCODE] = msg-opcode; Coήv- >IntTόBuflmsg seqjio, ((char ajrep buf)+MSG HOFFSET SEQ); Conv- >IntToBuf(msg en, ((char )rep_bu?)+MSG JHO FSET _LEN); void GenericReplyClass:.sendjeply() send_reply fill reply headerftype, opcode, seqjio, rep len); (void) Invoker- >send(rep_buf, MSG_HEADER_LEN-l-(repJen< <2)); msg obj states ErrorClass:_suceess return(CARD32 errjype. CARD32 msgjode, CARD32 seq j io) fill repiy_headerferr type, msg code, seq no, 0); Invoker- >βend(rep_buf, MSG~HEADER~LEN); retum(eJMSG_SERVICED); void ErrorClass:aend error(CARD32 errjype, CARD32 msg code, CARD3 " 2 seq_no, CARD32 errjode) fill reply headerferr type, msg code, seqjio, 1); Conv- >1ntToBufferr code, ffchar «)rep buf)+MSG HEADER LEN); if (Invoker- >send(rep_buf, MSG_HEADER_LEN+4Γ == - if return; ~ } msg_obj states ErrorClass::e action(CARD32 err type, CARD32 msgjode, CARD32 seq_no, CARD32 err code) { send errorferr type, msg code, seq_no, errjode); return(e_MSG_SERVICED); action int MRMRRequestαass::routing_action() routing _aciiθn int MRJd; (void) Conv- >Bu_ToCARD32(data+pos, resjen, nbytes, MRJd); poβ += nbytes; return(for some other_MR(MRJd)); } msg.C msg.C ,.,. ...rostιnj_αction void MedServRequestClass:_fill_request_headerO fiU request ieader headerfMSG HOFFSET TYPE] = type; headerlMSGΗOFFSET-CODE] = opcode; Conv- >IntToBufrseq_n " o, header+MSG HOFFSET SEQ); Conv- >IntToBufflen> >2, header+MSG_HOFFSET_LEN); void MedServRequestClass::common_build() common build req_buf.reservef4); Conv- >IntToBu-f room, (fchar a)req buf)+poβ); pos += 4; len = len_in_CARD32(poβ) < < 2; filljequesf header(); } build void EventClass::build(int src, int idl, int id2, int participant) build void EventClass::build(int src, int idl, int id2) build { len = 2; rep_buf .reserve(MSG_HEADER_LEN4-len« 4); fill " reply header(type^ opcode, seq_no, len); Conv— >TntToBufiidl, ffehar a)rep buf)+pos); pos += 4; Conv- >IntToBuf(id2, ((char a )rep )uf)4-pos); pos += 4; } void EventClass::build(int src, int idl, int id2, List(int)& plist) List int part; len = 3+plist.lengthQ; rep_buf.reserve(MSG_HEADER_LEN+lena4); fill " reply headerf type " , opcode, seq_no, len); Coήv- > ntToBuflidl, ffehar a)rep bufV+-pos); pos += 4; Conv- >IntToBuflid2, (fchar a)rep "" buf)4-pos); pos 4-= 4; Conv- >IntToBuf(plist.Iength(), ((cEar a)rep_buf)4-pos); pos 4-= 4; p list.resetf); while (plιst.nextfpart))f Conv— >IntToBuf(part, ((char « )rep_buf)4-pos); pos += 4; } void EventClass::build(int src, int roomjd, int meetingjd, Media med, Strϊήg& user j iesc) ~ { int part; len = len in CARD32(4+44-l4-44-user desc..ength()); rep bufreserve(MSG_HEADER LEN+lena4); Conv— >IntToBuf( roomjd, ((char *)rep_buf)4-pos); pos 4-= 4; msg.C msg.C Conv— >IntToSuif meetingjd, ((char «)rep buf)4-poβ); pos -= 4; ...List rep bufjpoβ4-4-l = (eharfmed; - Conv— >IntToBuif user desclength(), ((char «)rep buf)+pcβ); pαβ -= 4; strepy(((ehar a)rep_buT)4-poβ, user_desc); poβ 4-=- user_desc.length(); fill_reply_header(type, opeode, seqjio, len); void EventClass::build(int src, int roomjd, int meeting id, Media med, Striήg& userjiesc, Listfint)& plist) int part; len = len in CARD32(44-44-14-44-user desc.length()4-44-(4aplist.length())); rep bufTreβervefMSG JIEADER LEN4-lena4); Con nvv—— > >I innttT looBπuuζnroro5ommJ jdα,, ( (((cehnaarr aβ )jrreepp_jb>uuft))44--ppooββ));; p pooββ ++== 44;; C ~on nvv— >Int "T~o "Bu_fmeet ti-nngκJ iαα,, ((char a) -ep_ .buf .)+ . poβ); poβ += 4; rep buf [poβ4-4-l = (char) med; Conv— >IntToBuf(user desciength(), ((char a)rep_buf)+poβ); poβ += 4; strcpy(((char a)rep buTVt-poβ, user desc); poβ 4-= user_desc.iength(); Conv- >IntToBuf(plist.lengthO, ((char a)rep_buf)4-poβ); poβ 4-= 4; piist.resetf); ~ while (plιst.next(part))f Conv— >iiιtToBuf(part, ((char a )rep_buf)4-pos); pos 4-= 4; # if def DEBUG cout < < "NUMPART: " < < plist.length(); cout.flushO; # endif filljreplyjheaderftype, opcode, seqjio, len); void EventClass:-send eventf) send event { MmConnection conn; slist.resetf); while (sl_st.ne_ct(conn))( (void) NW- >Write(conn, rep_buf, MSG_HEADER_LEN4-(len< <2)); obj_man.C obj_man.C # include <obj_maa.h> # include < server eg_h> List f pimpiementfLocalSession) List~of ?implementfFrontEnd) >ut of ptmplement List~of_pimplementfReqMR) tst_orj)vnpϊement tstjo pxmplement CommObjMgr::CommObjMgrfMRInterface aifaee) CommObjMgr Ifaee = ifaee; void LoealSessionMgr::processfMmConnection cii) process { List of ύterfLocalSession) cli__t(clientj_3t); LocalSession a obj; clist.resetf); while (ciιst.next(obj)){ // check creation if (obj— >connection() == cli){ obj- > process msg(); garbagejollectf); returnf } } if (strcmp(cli- >NameTagf), "")) return; // Not a new client if ((obj = new LocalSession(Iface, cli)) == NULL) { cout < < "Fatal Mem. Allocation Error " < < FILE < < " " < < "_LINE__" < < endl; return; ciist.insertjιext(obj); obj— > process jnsgf); } void LocalSessionMgr::garbage_collectO garb age _collect { List of_piter(LocalSession) clist(clientjist); LocalSession «obj; clist.resetQ; while (chst.next(obj)){ if (!obj- >is_alive()){ delete obj; ciist.remove_prev(); } U //JU FrIoInItUEnIdUMUgrII m/IeIthIo/dUsH ////////////////////////// void FrontEndMgr::process(MmConnection cli) process L iisstt__of_piter(FrontEnd) clistfclient_-ist); F roronnttE] nd *obj; clist.reset(); while (chst.next(obj)){ // check creation if (obj— >connection() == cli){ obj— > processjnsgO; obj_man.C obj_man.C garbage_collect(); ...process return; if ((obj = new FrontEndflface, cii)) == NULL) { eout < < "Fatal Mem. Allocation Error " < < FILE < < " " < < "__LINE_" < < endl; ~ — return; ciist.insert_nextfobj ; obj— > process msgf); # if def DEBUG cout < < "Got conn, from front end\n"; cout.flushO; # endif > void FrontEndMgr::garbage_collectf) garbage collect Listjof piterfFrontEnd) clistfclientjist); FrontEnd aobj; ~ clist.reset(); while (chst.next(obj)){ if (!obj- >is_alive())f delete obj; clist.remove_prev(); // ReqNMMgr methods ////////////////////////// ReqNMMgr:-ReqNMMgr(MRInterface aifaee) : CommObjMgrf ifaee) CommObjMgr String machine; int port; MmConnection server; ehar host[HOST_NAME_LEN]; is live = 0; Ifaee— >ServReg()— > default name_server(πιachine, port); server = NW— >Cal_Serverfmachi e.dump(host), port); server- >NameTag("NM"); il handle error here (server— >h_Assignedf) == MmEnum:_MmFalse) { cout < < Cannot connect to " < < machine < < "::" < < port < < endl; return; } if ((nm obj =» new ReqNM(Iface, server)) == NULL){ " cout < < "Fatal Mem. Allocation Error " < < FILE < < " " < < __LINE_ < < endl; "" " ~ return; } is alive = 1; > int ReqNMMgr:-send_to_NM(Message amsg) send_ tθ_NM return(nm obj— >send request_msg(_nsg)); } void ReqNMMgr::process(MmConnection serv) process ob obj_man.C obj_man.C i ...process If (nm j obj— >connection() == serv) -nmj>bj— > processjnsgO; W // ϋ Re'q f JMMRMWgrff mfeitihloϋdJs 1111 iiii/iiiiimiiiiiiiiiiiii int ReqMRMgr:-send_tojMR(String machine, int port, Message amsg) send to MR ReqMR aobj; MmConnection server; ehar hostlHOST_NAME_LEN]; # if def DEBUG cout < < "Sending msg to other MR " < < machine < < "::" < < port < < endl; cout.flushO; # endif server = NW— >CallServerfmachine.dump(hαβt), port); server- >NameTag("MR"); a handle error here (server— >IsAssigned() =-= MmEnum::MmFalse) f cout < < "Cannot connect to " < < machine < < "::" < < port < < endl; return!— 1); } if ((obj = new ReqMRflface, server)) == NULL){ cout < < "Fatal Mem. Allocation Error < < FILE < < " " < < "___LINE_" < < endl; ~ ~ retumf— 1); server Jist-insertjiextfobj); returnfobj— >sehd jequest jnsgfmsg)); void ReqMRMgr::process(MmConneetion serv) process List of piterfReqMR) clist(server list); ReqKffT aobj; clist.reset(); while (chst.next(obj))f if (obj— >connection() == serv){ obj— > process msgf); garbage j ollectf); return;- void ReqMRMgr::garbagejollect() garbage_Cθllect List of piterfReqMR) clistfserver list); ReqKffiTaobj; cϋst_resetf); while (chst.next(obj)){ if (!obj- >is aliveOH N • ~W " -- "- >>HHawnιβgUUιp(obj— > connection()); delete obj; clist.remove_prev(); proto.C proto.C # include <ifaceJι> Protocol: _Protocol(MRInterface aifaee) Protocol Ifaee = ifaee; Conv = Ifaee- >Conv(); for (int i = 0; i < MAX MSG TYPES; i4-4-)f for (int j = 0; j < MAX MSGS; j4-4-)f Gen_func_tab[i][j] =~ProtoGenerator::default_generator; Gen func tab (REQUEST MR_SERVER FMR CREATE ROOM! = ProtoGenerator::Gen CreateRoom; Gen~funcJab[REQUEST " MR SERVER [MR-DESTROY ROOM] = ProtoGenerator::Gen DestroyRoom; Gen-func tab REQUESTMR SERVER [MR " LIST ROOMS] = ProtoGenerator::Gen_L-stRooms; Gen~func " tab REQUESTMR-SERVER [MR~SHOW ROOM STATUS! = ProtoGeneratorΛen ShowRoom Gen Junc " tab REQUESTMR "" SERVER fMR~SHOWjlOOM~ATTRIBUTES] = ProtoGeneratorT:Gen_Show Gen fune " tab REQUEST-MR-SERVER' [MR ALTER " ROOM " ATTRIBUTES] = ProtoGeneratorr.Gen ter Gen-func-tab REQUESTMR-SERVER [MR " LOCK ROOM] ~= ProtoGenerator::Gen LockRoom; Gen~func~tab REQUESTMR-SERVER [MR-UNLOCK ROOM! = ProtoGeneratorrGen UnlockRoom; Gen-func " tablREQUESTMR-SERVER (MR-SHOW ASSOCIATED ROOM1 = ProtoGenerator::Gen Show Gen June jab (REQUEST_MR_SERVER [MRjsHOW \SSOCIATEDjMEETING] = ProtoGenerator::Gen_Sh Genjunc Jab[REQUEST MRjSERVER [MR CREATE MEETING] = ProtoGenerator::Gen_CreateMeet_ng; Gen unc tab REQUEST "" MR SERVER IMR " T ) ESTROY_MEETING] = ProtoGenerator::Gen DestroyMeeti Gen func jab REQUEST~MR-SERVER [MRT.IST MEETINGS] = ProtoGenerator::Gen ListMeetinβ; Gen " func tab REQUEST " MR-SERVER [MR~SHOW MEETING STATUS1 = ProtoGenerator::Gen ShowM Gen-func-tab REQUEST~MR-SERVER IMR-SHOW-MEETROOM STATUSl = ProtoGeneratoκ:Gen Show Gen-func " tab REQUESTMR " SERVER [MR-SHOW-MEETING ATTRIBUTES! = ProtoGenerator::Gen S Gen~func " tab REQUESTMR-SERVER tMR "" ALTER " MEETINσ ATTRIBUTES] = ProtoGenerator-Gen " A Gen-func-tab REQUESTMR-SERVER lMR "" ADD PΛRTICIPA T]_= ProtoGenerator::Gen AddParticipan Gen-func jab REQUEST~MR-SERVER [MR " DROP PARTICIPANT] = ProtoGenerator::Gen DropParticip Gen-func tab REQUEST~MR-SERVER (MR-LEAVE MEETING] = ProtoGenerator:Gen LeaveMeeting; Gen-func-tab REQUESTMR-SERVER (MR~REENTER MEETING] = ProtoGenerator-Gen ReenterMeeti Gen-f unc~tab |REQUEST~MR " SERVER tMR-SUSPEND " MEETING] = ProtoGenerator::Gen " SuspendMeeti Gen Junc-tab [REQUESTMR-SERVER [MRJRESUME MEETING] = ProtoGenerator::Gen ResumeMeetin Genjunc tab REQUEST MR SERVER! (MR ADD SERVER! = ProtoGeneraton:Gen_AddServer; Genjunc tab REQUESTMR " " SERVERlfMR DROP SERVER] = ProtoGenerator::Gen DropServer; Genjunc " tab REQUEST-MR " " SERVERKMR SET SERVER ACCESS_LIST] = ProtoGenerator::Gen_SetSe Genjunc " tab REQUEST-MR ' " SERVER! [MRT.IST SERVERS! = ProtoGenerator::Gen ListServers; Genjunc " tab REQUESTMR ' " SERVER! [MR " ~SUSFEND SERVER] = ProtoGenerator:: ' Gen SuspendServer: Genjunc " tab (REQUESTMR ' " SERVER! .MRJIESUME SERVERl = ProtoGenerator::Gen ResumeServer; Gen-func " tab [REQUESTMR ' " SERVER! [MR_GET_SERVER INFO] = ProtoGenerator::Geh_GetServerInfo; for (int j = 0; j < MAX REGISTRY SERVER MSGS; j++) Genjunc jab[REQUEST_REGISTRY_SERVER][j] ~= ProtoGenerator::Gen_NameServerMsg; GenJuncJab[REQUEST_MRJSERVER][MR_DISCONNECT] = ProtoGenerator.:Gen_Disconnect; void Protocol::interpret headerf ehar aheader, CARD8& type, CARD8£ " opcode, CARD32& seq, CARD32& len) int tmp; type = headerlMSG HOFFSET TYPEl; opcode = header [MSG HOFFSET CODE!; if (type < 0 || type > MAX MSG TYPES) type = 0; if (opcode < 0 J| opcode > MAX MSGS) opcode = 0; seq = Conv- >BufToInt(header4-MSG HOFFSETJSEQ); # if def DEBUG // cout < < "IN PROTO SEQ: " < < seq < < endl; # endif proto.C proto.C tmp = Conv- >BufToInt(header+MSG HOFFSET LEN); ...Protocol len « tmp<<MSG UNIT; } Message a Protocol-construct msgfchar aheader, CARD8 type, CARDS opcode, " CARD32 seq, CARD32 len, ehar adata, Connection aconn) if (type >= MAX MSG TYPES || opcode >= MAX MSGS){ cout << 111e«rType/Opcode: " << (int)type << " " << (in pcode << endl; type = REQUEST_MR_SERVER; opcode = MAX_MSGS-1; retum(Gen unc_tab[(int)type][(int)opcode](header, type, opcode, — * ~ seq, len, data, conn)); } room.C room.C # include <obj_manJι> # include < room.h > # include <ifaceJι> # include <med_servJι> # define DEFAULT_ROOMS 1000 Listimplement int) Liβtimpl ement Listimplement(String) _ . _ Listvnpl ement Listjof pimplementlRoom) List j ofjpimplementf Conferee) ListιmpIement(ParticipantΙnfo) fcS-SB '" ement , , r ement -. r -t-mplement ListjofjpimplementfMediaDese) itst 0L__pvn.pi ement Listjf j pimpiement FullMediaDesc) ,ι&t~oj~j)vnplement List-o { _pimpiementfMediaServerInfoInRoom) iisfoj pxmplement ////////////////////////////////////////////////// // Room Methods ////////////////////////////////////////////////// Room::Room(int roomjd, CARD32 rowner, RoomAttrib rattr, - String& rname, RoomMgr arRMgr) id = roomjd; attrib = rattr; MR id = owner = rowner; status = e EMPTY ROOM; lock tatus~= eJJNLOCKED; meeting = (MeeTmg «)NULL; if (rname == "") room name = "NoName"; elae room name = rname; RMgr = rRMgr; MSMgr = RMgr- >MRIfaceQ- >MediaServerManagerf); EveNot = RMgr- >MRIface()- >EveNotifιer(); EveNot- >RoomCreated(RoomId(), 0); // src is 0 (MR) } int Room::lock() lock { if (lock status == e LOCKED) retura(- ERITROOM _LOCKED); lock status = e LOCKED; EveNot- >RoomLocked(RoomId(), 0); return(SUCCESS); } void Room::meeting_created(Meeting am) meeting _created { set meetingfm); if fm) { if (server list.length() > 0) st tus = e ROOM W MEETING RESOURCES; else - - - status = e ROOM W MEETING; } - - - } void Room::meeting_destroyed() me etingjdestroye d { MediaServerlnfoInRoom ainfo; serverjist.resetf); while (server lιst_next(info)) { if (info- >scope == e MEETING SCOPE) f MSMgr— >DropServer(RooπϊId(), info— >server); room.C room.C delete info; . meeting ^ destroyed βerver_list.remove_prev(); if (server lis engthQ > 0) status = e_ROOM_W_RESOURCES; else — — - status = e_EMPTY ROOM; set_meeting((Meetirig a) NULL); } int Room::unloek() unlock f if (lock status == e UNLOCKED) retura(-ERR " ROOM ALREADY UNLOCKED); lock status = e UNLOCKEDf EveNot- >RoomUnloeked(RoomId(), 0); return(SUCCESS); } void Room:_set_meeting(Meet_ng am) set_meeting meeting = m; Room::~Room() Room { int m; if (meeting) delete meeting; # if def DEBUG cout < < "Room " < < id < < Deleted\n"; cout.flushf); # endif έ l Should send room destroyed event to all servers veNot- >RoomDestroyed(RoomId(), 0); // src is 0 (MR) } void Room::MediaServerDied(int id) MediaServerDied MediaServerlnfoInRoom ainfo; serverJist.resetQ; while-(server iιst.next(info)) f if (info— >server == id) { delete info; server_list.remove >rev(); } int Room::is_server >resentfint serverjd) is_server_present List of piterfMediaServerlnfoInRoom) slist(serverj-st); MediaServerlnfoInRoom ainfo; ~ slist .resetf); while (slιst.next(info)){ if (info— > server == serverjd) returnfl); ~ return(O); } int Room::add serveifint server id, Media media, String& user desc, Listfint)& part list) { room.C room.C ™* P>_ , ...is server jretent MediaDesc med; MediaServerlnfoInRoom ainfo; server_list.reβetf); while-(server hst.next(info))f if (info— >server == server id)f return(— 1); - info = new MediaServerlnfoInRoom; info— >server = server id; info- > status = e SERV NORMAL; info- >scope = (has meetingf)) ? e_MEETJNGjSCOFE : e_ROOM_SCOPE; server list. insert iextfinfo); — EveΝόt- >ServerAdded(0, RoomldQ, has meetingf) ? meeting— >MeetingId() : 0, media, user_desc, partjist); ined-server = media; med.user_desc = userjiesc; if (hasjneetingO) { ~ part iist.resetf); while (part_lιst.next(p)){ "" meeting- >add_mediafp, med); EveNot- >MeetingInfo(RoomId(), 0, meeting- >MeetingId()); status = e_ROOM_W_MEETOIG_RESOURCES; else 5 status = e_ROOM_W_RESOURCES; returafO); - - } int Room:_set_access listfint server id, Media media, String& user dese, List(διt)& part_list) int p; MediaDesc med; med -server = media; med.user_desc = userjiesc; if (hasjneetingO) { " "" meeting— >restrict_media_access(part_list, med); EveNot— >ServerAccessListSet(0, RoomId(), has meetingf) ? meeting— >MeetingId() : 0, media, user j iesc, partjist); retura(O); int Room: :drop_serverf int serverjd, Media media, String& user j iesc) drop_Server MediaDesc med; MediaServerlnfoInRoom ainfo; server_Iist.resetf); while (server lιst.next(info))f if (info— > server == server_id)f delete info; ~ server_list.remove_prev(); med^erver = media; med.user_desc = userjiesc; if (has j neetingO) meeting— >drop_media(med); room.C room.C ...drop server EveNot- >ServerDropped(0, RoomId(), has meeting() ? meeting- >MeetingId() : 0, media, user desc); if (server IistJength() == 0) status = (hasjneetingO) * e_ROOM_W_MEETING : e_EMPTY_ROOM; return(O); } int Room:-suspend_serverfint serverjd, Media media, String& user j iesc) SUSpend_Server MediaDesc med; int s; MediaServerlnfoInRoom ainfo; List_of_piter(MediaServerInfoInRoom) slist(server_list); slist.resetf); while (s_ιst.next(info))f if (info— > server == server id) info- > status = e_SERV_SUSPENDED; med.server = media; med.user_desc = user_desc; if (hasjneetingO) - meeting— >suspend_media(med); return(O); int Room::resume_βerver(int serverjd, Media media, String& user j iesc) resume_s ve MediaDesc med; int s; MediaServerlnfoInRoom ainfo; List j ofjpiteifMediaServerlnfohiRoom) slistfserver Jist); slist .resetQ; while (slιst.next(info)){ if (info— >server == server id) info- >status = e_SERV_NORMAL; med .server = media; med.user_desc = userjiesc; if (hasjneetingO) meeting— > resume jnediaf med); return(O); int Room::list j erversfList j of_p(FulIMedis_Desc)& media Jist) List_θf_p int s; List of piterfMediaServerlnfoInRoom) slist(serverjist); FuUMediaDesc am; MediaServerlnfoInRoom ainfo; MediaServerConn connjnfo; Media media; ~ String userjiesc; media_list.reset(); slist.resetf); while (slιst.next(info))f if (MSMgr— >get server info(info— >server, media, userjiesc) >= 0){ m = newTullMediaDesc; m— > server = media; m— > user j iesc = user_desc; m— >statύs = info— > status; room.C room.C if (MSMgr— >ge jnanager_connection(media, user desc, ...Li*t_of__p " - connjnfo) >= 0) X m— > machine = connjnfo jhachine; m— >port = conn j nfo.port; media Jist jnsert_nextfm); return(0); void Room::assoeiatedjerversfListfint)& serv Jist) List List of piterfMediaServerlnfoInRoom) slistfserver list); MedϊaServerlnfoInRoom ainfo; - serv_list.reset(); siistlresetf); while (siιst.next(info)){ serv_list.insert_next(info— > server); l /l/JU MJeeItIiJnIgII ////////////////////////////////////////////////// Meeting::Meetingfint meetingjd, CARD32 mowner, RoomAttrib mattr, Room ~amroom, RoomMgr amRMgr) id = meetingjd; attrib = mattr; owner = mowner; RMgr = mRMgr; EveNot = RMgr- >MRIface()- >EveNotifιerf); room = mroom; status = e_MNORMAL; EveNot- >MeetingCreated(room- >RoomId(),0,MeetingId()); // Add the owner as a participant (void) add )articipant(owner); Meeting::~Meeting() Meeting drop all participantsQ; έl SEou send meeting destroyed event to all servers veNot— >MeetingDestroyed(room— >RoomId(),0-MeetingId()); int Meeting: _state_check() state_ckeck if (status == e MSUSPENDED) retura(-ΕRR MEETING SUSPENDED); if (room- >room lock-statusf) == e LOCKED) retura(-ERR " ROOM LOCKED); } void Meeting::get_meeting_infofList(ParticipantInfo)& info) List List ofjpiter(Conferee) clist(conf_list); Con7eree ac; Participantlnfo p; ciist.resetf); info.resetQ; while (chst.next(c)){ p.participant = c— >ID(); room.C room.C p.mediajist = c— >get_media_list(); ...List info_insert_nextfp); "" } void Meeting::get_meeting )articipantsfListf_nt)& plist) List { List oCpiterfConferee) clistfconfjist); Conreree ac; - int Meeting::add_participant(int participant) add p arϋcipant { Conferee ac; if ({err = statejheck()) < 0) retura(err); co list.resetf); - while (conf_iιst.next(c)){ if (c— >ID() -β participant) retura(- ERR_PARTICIPANT_ALREADY_PRESENT); if (c = new Conferee(participant)) conf list-insert next(c); elaef eout < < "Fatal mem alloc error: " < < __FILE_ < < " " < < _LINE cout.flushO; retura(- ERR_NO_RESOURCES); EveNot- >AddedParticipant(room— >RoomId(),0-MeetingId(), participant); return(SUCCESS); ) int Meeting::drop_participant(int participant) drop particip ant { Conferee c; if ((err = state_check()) < 0) return(err); conf list.reset(); while (conf_lιst.next(c)){ if (c— >π>() =--= participant)! delete c; conf listjemove_prevf); EveNot— >DroppedParticipantfroom— >RoomIdf),0, Meetingld(), participant); change ownerQ; returafSUCCESS); return(- ERR_PARΗCIPANT_NOT_PRESENT); ) void Meeting::change_owner() change_owner { Conferee ac; conf list.reset(); if (cόnf list.next(c))f It (c) { owner = c— >-D(); # ifdef DEBUG cout < < "New Meeting Owner: " < < owner < < endl; room.C room.C # endif ...ckange_oκner } } int Meeting:-suspend_meeting() suspend meeting { if (status == e MSUSPENDED) retura(-ERR MEETING SUSPENDED); status - e MSUSPENDED; ~ ■ ~ EveNot- >MeetingSuspended(room- >RoomId(),0, MeetingldO); retum(SUCCESS); } int Meeting:_resume_meet_ngf) resume _meeting { status = e MNORMAL; EveNot— >MeetingResumed(room— >RoomId(),0, MeetingldO); returo(SUCCESS); } void Meeting::drop_all_participantsf) drop_all_participants { Conferee ac; conf list.resetf); while (conf iιst.nextfc)){ EveNot— >DroppedParticipant(room— >RoomId().0, Meetingldf), c- >IDf)); delete e; conf Jist .remove_prev(); } void Meeting::add_media(CARD32 participant, MediaDesc med) add media { List of j piteτfConferee) clist(conf_list); Conleree ac; — clist.resetf); while (chst.next(c)){ if (c- >ID() == participant)f c— >add_media(med); break; } } } void Meeting::drop_media(CARD32 participant, MediaDesc med) drop_media { List of j piterfConferee) ciistfconfjist); Conferee ac; - clist.reset(); while (cl_st_nextfc))( if (c- >ID() == participant)! c— >drop_media(med); break; ~ } } } void Meeting::drop_media(MediaDesc med) drop media { List of_piter(Conferee) clist(conf_-ist); ConTeree ac; clist.reset(); while (clιst.next(c)){ room.C room.C c— >drop_mediaf med); ...iro meiia } void Meeting:-suspend_mediafMediaDesc med) suspend nedia { List of j piterfConferee) clist(conf_list); ConTeree ac; - clist.resetf); while (chst_next(e))f c— > suspend jnediafmed); } void Meeting::resume_mediafMediaDesc med) resume media { List ofjpiterfConferee) clistfconf Jist); ConTeree ac; - clist.resetQ; while (chst.next(c))( c— > resume jnediaf med); } void Meeting::restriet_media_aceeas(List(int)& part_list, MediaDesc med) List { List of_piterfConferee) clist(confJist); ConTeree ac; — clist.resetf); while (chst-next(c)){ part list.resetf); if (part_list.fmd next(c- >ID())) c— >addjnedιafmed); elae - c— > drop jnediafmed); } int Meeting::leave_meeting(int participant, ~ List_of_p(MediaDesc)& mediajist) L t of_piter(Conferee) clist(conf_list); ConTeree ac; ~ clist.reset(); while (clιst.next(c)){ if (c- >IE)f) == participant)! c— >suspend mediafmedia_list); EveNot- >Le Meeting(room- >RoomId(),0>leetingId(), participant); returafO); return(- ERR_PARΗCTPANT_NOT_PRESENT); } int Meeting::reenter meeting(int participant, - L-st_of_p(MediaDesc)& media_list) { List of_piter(Conferee) clist(confjist); ConTeree ac; clist.resetf); while (clιst.next(c)){ if (c— >ID() == participant)! room.C room.C c— > esume mediafmedia list); ...List EveNot- >HeenterMeeting(room- >RoomId(),0,MeetingIdQ, return(0); participant); retura(- ERR_PARΗCIPANr_NOT_PRESENT); //// ///////////////////////////////////////////// // Conferee Methods ////////////////////////////////////////////////// Conferee::- Confereef ) Conferee FullMediaDesc am; media Jist .resetf); while~(mediajιst.next(m))! delete-m; } void Conferee::add_mediafMediaDesc med) add edi FullMediaDesc am; media_list.resetf); while-(media_lιst.nextfm)){ if (m— >server == med .server &.&. m— >user_desc == med.user j dese) return; — ~ if (m = med.user desc; mediajist.insertjnext(m^ void Conferee::drop_mediafMediaDesc med) drop media FullMediaDesc am; mediajist .resetf) ; while-(media_lιst.next(m))! if (m— >server == med. server && m— >user_desc == med.user desc)( media_list.remove_prev(); — - delete~m; return; } void Conferee::suspend_media(MediaDe3c med) 8USpend_ τnedia FullMediaDesc am; mediajist .resetf ) ; while-(media_lιst.nextfm))f if (m— >server — -= med -server && m— >user_desc == med.user desc)! m- > status = e_SERV_SUSPENDED; return; ~ } void Conferee:_suspend_media(Listj.f_p(MediaDesc)& med_list) List_0j_ ) room.C room.C FuUMediaDese am; Lilt 0 t . MediaDesc amdesc; med list.resetf); while (medjιst.next(mdesc)){ media Jist.resetf); while-(media_lιst.nextfm))! if (m— >server == mdesc- >server &.&. m— >user desc == mdesc— >user desc)! m- >statϋs = e_SERV_SUSPENDED; void Conferee::resume_mediafList_ofjp(MediaDesc)& medjist) List_θf__p FullMediaDesc am; MediaDesc amdesc; med list.resetf); while (medjιst.next(mdesc))! mediajist.resetf); hile-( medi Jιst.next(m)){ if (m— >server == mdesc— >server && m— >user_desc == mdesc— > user desc)f m- >status = e SERV NORMAL " • ' ' ' void Conferee::resume_mediafMedιaDesc med) resume_ media FullMediaDesc am; mediajist.resetf); while-(media_Iιst.next(m))! if (m— >server == med.server && m— >user desc == med.user desc)! m- >status = e_SERV_NORMAL; return; - } » ( ////////////////////////////////////////////////// // RoomMgr Methods ////////////////////////////////////////////////// RoomMgr-RoomMgrfMRInterfaee aMRIface, Range r) RoomMgr Ifaee = MRIface; if (r^tart <= r.end) r.end = r_start 4- DEFAULT_ROOMS; for (int i = r.end— r -start; i >= Of i ) ! free_roomJdJist.insert_next(r.start4-i); free meeting— d list.insert next(r.start4-i); } range = r; RoomMgr::" RoomMgrf) RoomMgr Room »r, room list.reset(); while " (room lιst.next(r)) if (r delete r; room.C room.C } ...RoomMgr int RoomMgr:3s_vaIid_room(int roomjd) is valid room riterfroomjist); liter .reset(); while (riter.nextfr))! if (r— >RoomIdQ == roomjd) return( 1); retura(O); } int RoomMgr::generatejoom_id() generate ro om_id int id; Jree roomjd list.resetf used " ι -omjά!J-St.reseti_,, if (free room j djist.next(id)) { " ϊree roomjd list.remove_prevf); used_roox_ .id^li3t.insert_next(ια); ret rn(id) - - - retura(— 1); } // LATER: SOme bug in list deletion; check later void Roo___Mgr::freejoom_-d(int id) free_room_id { usedjoomjd list.resetf); free roomjd Jist.resetf); if (usedjOom_id_list.-ιnd_next(id)) { used_roomJd list.remove3revQ; free_roomjdJist.insert_next(id); } } int RoomMgr: :generate_meeting_id() generate _meeting_id { int id; free meetingjd list.resetQ: used " meetingjdJist.resetO; if (free meetu-g djist.nextfid)) { Tree mee " tingjd list-remove_prevf); usedjmeeting^.id_listjnsertjιext(ια); returnfid); - - - return(— 1); } II LATER: SOme bug in list deletion; check later void RoomMgr::free_meetingJd(int id) fre e_meeting_id usedjneetingjd list.reset(); freejneetingjdji3t_resetf); if (ωed_meetingjd_li3t. ιd_next(id)) { usedjneetingjd list. " femove_prevQ; free meeting Td " EsLinsert next(id); } - - - } int RoomMgr::CreateRoom(CARD32 owner, RoomAttrib attrib, String& rname) CreateRoom room.C room.C i ...CreateRoom Room ar; // ADD SECURITY LATER int id = generate room id(); if (id < 0) - - retumf- ERR NOJRESOURCES); if ((r = new Roomfid owner.attrib. rname, thb)) == NULL) retura(- ERR_NO_RESOURCES); roomjist.insertjiextfr); returned); - int RoomMgr:_DestroyRoom(CARD32 requester, int roomjd) DestroyRoom Room ar; .roomjist.resetf); " while (room_iιstΛext(r)){ if (r— >Roomlα() == room id)f // ADD SECURITYTATER free_roomJd(room_id); deleϊe r; - ~ room list.remove >rev(); , — «— * retumf- ERRJBAD JHOOMjD); int Rooπ_Mgr:_L_3tRooms(CARD32 requester, List(int)& rlist, List(String)& name_list) Room r; List_ f_piter(Room) riter(room_list); // ADD SECURITY LATER riist.resetf); riter .resetf); name_list.reset(); while " (riter .next(r))f rlist.insertjiext(r— >Roomid()); name_iist.ύ_ιsert_next(r— >RoomName()); return(SUCCESS); int RoomMgr::ShowRoomStatusfCARD32 requester, int room id, RoomStatU-kfe stat, RoomLockStatus^ lock tat) Room ar; List_of_piterfRoom) riterfroomjist); // ADD SECURITY LATER πter.resetf); while (riter.nextfr))! if (r- >RoomId() === roomjd)! stat = r— >room tatusf); lockjtat = r— >room_lock statusf); returafSUCCESS); return(- ERRJBAD JROOMJD); int RoomMgr::ShowRoomAttributes(CARD32 requester, room.C room.C int roomjd, RoomAttrib& attrib) ...Destro f Room Room ar; List_of_j»iterfRoom) riterfroomjist); // ADD SECURITY LATER . πter.reset(); while (riter.nextfr))! if (r- >RoomId() == roomjd)! attrib = r— >room attrib(); return(SUCCESS); - return(- ERR_BAD_ROOMJ_D); int RoomMgr:-AlterRoomAttributes(CARD32 requester, int roomjd, RoomAttrib attrib) ~ Room ar; Listjof piterfRoom) riterfroom_list); // ADD SECURITY LATER nter.resetf); while (riter.next(r)){ if (r— >RoomId() == room id)( r— >set room attribfattrib); returafSUCCESS); retura(- ERR_BAD_ROOM_ID); } int RoomMgr:-LockRoom(CARD32 requester, int roomjd) LockRoom { Room ar; List_of j piterfRoom) riterfroomjist); // ADD SECURITY LATER nter.reset(); while (riter.nextfr))! if (r- >RoomId() == roomjd) return(r— >lock()); retum(- ERR_BAD_ROOM_ID); int RoomMgr::UnlockRoom(CARD32 requester, int roomjd) UnlockRoom Room ar; List_of j piter(Room) riterfroomjist); // ADD SECURITY LATER πter .resetf); while (riter.nextfr))! if (r— >RoomId() == room id) retum(r— >uniock()JJ return(- ERR_BAD_ROOMJD); int RoomMgr::CreateMeeting(CARD32 owner, CARD32 room id, MeetingAttrib attrib) { Room r; Meeting am; room.C room.C List_ f_piterfRo m) riter(room_list); ...Ui ockRoom nter.resetf); while (riter iextfr))! if (r- >RoomId() == room id)( if (r- >has meetingf]) returnf- ERR_ROOM_HAS_MEETING); else! int id = generate meeting id(); if (id < 0) retumf- ERR_NO_RESOURCES); if ((m = new Meetingf id, "" owner, attrib, r, this)) == NULL) return(ERR NO_RESOURCES); r— > meeting jreateάf m);- retura(id); ~ , ' ' return(-ERR BAD ROOM ED); } " " int RoomMgr::DestroyMeeting(CARD32 requester, int meetingjd) DestroyMeeting Room ar; Meeting am; List_of -iter(Room) riteifroomjist); // ADD SECURITY LATER πter.reset(); while (riter.next(r))! if ((m = r- >getjneeting()) != (Meeting a)NULL &.&. m— >MeetIngId() == meetingjd)! freejneetingjdfmeetingjd); - delete m; - - r— > meeting destroyed(); retum(SUCCESS); » > retum(- ERR_BAD_MEET1NG_ID); int RoomMgr::ListMeetings(CARD32 requester, List(int)& rlist) List Room r; Meeting am; List_of_piter(Room) riterfroomjist); // ADD SECURITY LATER rlist .resetf); riter .resetf); while (riterjιext(r))! if (m = r— >get_meetingf)) rlist insert iextf — > MeetingldO); return(SUCCESS); int RoomMgr::ShowMeetingStatus(CARD32 requester, int meetingjd, List(ParticipantInfo)& info, int& p roomjd, ~ int& owner, MeetingStatus& status) ~ { Room ar; Meeting am; List_of_piter(Room) riterfroom_list); // ADD SECURITY LATER πter.reset(); room.C room.C while (riter Jiext(r))! ,.d.ist if ((m = r- >getjneetingf)) != (Meeting a)NULL && m-ό>MeetingId() ==- meetingjd)! m— >get meeting_info(-nfo): ~ pjoomJH = r- >RoomId(); owner = m— >get_meeting_ownerf); status = m— >get meeting-status(); return(SUCCESS);- } retum(-ERR - BAD - MEETING - ID) i ; int RoomMgr::ShowMeetRoomStatus(CARD32 requester, int room id, List(ParticipantInfo)& info, int& p meetingjd, ~ int& owner, MeetingStatus^ status) { Room ar; Meeting am; List_ f_piter(Room) riteifroomjist); // ADD SECURITY LATER riter .reset(); while (riter.next(r)){ if (r— >RoomId() == roomjd) { if (m = r- >get_meetingf))! m— > get jneetingjnfof info); p_meeting_id = m— >MeetingId(); owner = m— >get_meeting_ownerf); status = m— >get-meeting-statusf); return(SUCCESS);- elae { p meeting id = owner = — 1; return(SUCCESS); retum(- ERR_BAD_MEETING JD); } int RoomMgr::ListMeetingParticipants(int meetingjd, L t(int)& plist) List Room ar; Meeting am; L t_of_piter(Room) riterfroomjbt); // ADD SECURITY LATER nter.reset(); while (riter.next(r)){ if (fm = r- >get_meeting()) != (Meeting *)NULL && m— >MeetingId() == meetingjd)! m— >get meeting participantsfplist); ~ retura(SUCCESS); retum(- ERR_BAD _MEETING_ID); int meeting id, attrib) ~ Room r; Meeting am; L t_of >iter(Roo_n) riter(room_-bt); // ADD SECURITY LATER riter .reset(); room.C room.C while (riter.next(r))! £„. if (f = r- >get_meeting()) != (Meeting a)NULL &&, m- >MeetingId() == meeting id)f attrib = m— >get meeting attrib(); - retura(SUCCESS);- retum(- ERR_BAD_MEETING D); int RoomMgr::ShowAssociatedMeeting(CARD32 requester, int roomjd, int& meetingjd) Room r; Meeting am; Lbt j of_piter(Room) riteifroomjbt); // ADD SECURITY LATER riter .resetf); while (riter.next(r))f if (r— >RoomIdQ == room id) if (r- > hasjneetingfj <&& (m = r- >get_meeting()))! meeting id = m— >MeetingId(); return(5UCCESS); else retum(- ERR_ROOM_HAS_NO_MEETING); retumf- ERR_BAD_ROOM_ID); int RoomMgr::ShowAssociatedRoom(CARD32 requester, int meetingjd, int& roomjd) — Room r; Meeting am; Lbt_of_piter(Room) riterfroomjbt); // ADD SECURITY LATER riter .reset(); while (riter.next(r))! if (r— > hasjneetingQ && (m = r— >get_meetingf)) && m— >MeetingId() == meeMngJd)! room id = r— >RoomIα(); retufh(SUCCESS); return(- ERR_BAD_MEETING JD); int RoomMgr:_AlterMeetingAttributes(CARD32 requester, int meetingjd, MeetingAttrib attrib) — Room ar; Meeting am; Lbt j of piterfRoom) riteifroom_lbt); // ADD SECURITY LATER nter.resetf); while (riter.next(r)){ if ((m = r- >get_meeting()) != (Meeting a)NULL &&. m- ;" >MeetingId() == meetingjd)! m— >set meeting attrib(attrib); retura(SUCCESST; } retum(- ERR_BAD_MEETING_ID); room.C room.C } ... ύt int RoomMgr:-AddParticipant(CARD32 requester, int meetingjd, int participant) { Room ar; Meeting am; List_of_piterfRoom) riterfroomjbt); // ADD SECURITY LATER nter.reset(); while (riter.next(r))! if ((m = r- >get_meeting()) != (Meeting a)NULL && m— >MeetingId() == meetingjd)! retumf m— >add_particιpant(participant)); } } retumf- ERR_BAD_MEETING JD); } int RoomMgr:-DropParticipantfCARD32 requester, int meetingjd, int participant) { Room ar; Meeting am; int err; Lbt_pf_piter(Room) riterfroomjbt); // ADD SECURITY LATER nter .resetf); while (riter.nextfr))! if (fm = r- >get_meeting()) != (Meeting a)NULL && m- -MeetingldQ == meetingjd)! err = m— >drop_participant(participaEt); if (m— >numjoή7erees() == 0) f delete " m; r— >meeting_destroyed(); retura(err); } } return(- ERR_BAD_MEETING_ID); mt RoomMgr::SuspendMeeting(CARD32 requester, int meetingjd) Susp endMe e ting ( Room ar; Meeting am; Lbt_of_piterfRoom) riterfroomjbt); // ADD SECURITY LATER nter .resetf); while (riter-nextfr))! if ((m = r- >get_meeting()) != (Meeting a)NULL && m- MeetingId() == meetingjd)! return(m— >suspend_meeting()); — } } return(- ERR_BAD_MEETING_ID); int RoomMgr:-ResumeMeeting(CARD32 requester, int meetingjd) ResumeMeeting { Room ar; Meeting am; Lbt_of_piter(Room) riterfroomjbt); // ADD SECURITY LATER room.C room.C riter .resetf); .RttmtneMeeting -while (riter_next(r))f if ((m « r— >get_meetingf)) != (Meeting a)NULL && m— > Meetingld() == meetingjd)! retumf m— > resume jneetingf)); ~ retumf- ERR_BAD_MEET1NG_ID); int Rooπ_Mgr:_AddServer{int roomjd, int serverjd, Media media, String& userjiesc, Lbt(int)& part Ibt) { Room ar; Lbt_of_piterfRoom) riterfroom_lbt); riter .resetf); while (riterjiextfr))! if (r— >RoomId() == roomjd) retum(r— >add erver(serverjd, media, user_desc, part lbt)); } return(- ERR_BAD_ROOM JD); int RoomMgr: .DropServerfint roomjd, int serverjd, Media media, - Stri£g& userjiesc) Room ar; Lbtj>f_piterfRoom) riterfroomjbt); riter .resetf); while (riter.nextfr))! if (r- >RoomId() == roomjd) returnfr— >dropjserver(server_id, media, user j iesc)); retura(- ERR_BAD_ROOM JD); int RoomMgr:-SuspendServer(int roomjd, int serverjd, Media media, String&-user_desc) Room ar; Lbt_of_piterfRoom) riterfroom_lbt); riter .reset(); while (riter.next(r)){ if (r— >RoomId() == roomjd) returnfr— >suspend_server(serverjd, media, user_desc)); return(- ERRJBAD_ROOM_ID); int RoomMgr-ResumeServerfint roomjd, int server id, Media media, StringjT user_desc) Room ar; Lbt_of j piter(Room) riterfroomjbt); riter .resetf); while (riter. nnee:xt(r)){ if (r- >RoomId() == roomjd) returnfr— >resume_server(serverjd, media, userjiesc)); return(- ERR_BAD_ROOM_ID); int RoomMgr::SetAccessLbt(int roomjd, int serverjd, room.C room.C Media media, String& user_desc, Lbt(int)& part_lbt) ...ResumeMeetin j Room ar; Lbt j of j piterfRoom) riterfroom_lbt); riter _reset(); while (riritteerr__nneexxtt((rr))))!! if (r- >RoomId() == roomjd) retura(r- >set_accessj_st(server_id, media, user j iesc, part_lbt)); retumf- ERR_BAD_ROOMJD); int RoomMgr:_LbtServers(CARD32 requester, int room id, Lbt_of_p(FullMediaDesc)& media_lbt) Room ar; Lbt_of_piter(Room) riterfroomjbt); τiter.reset(); while (riter.nextfr))! if (r— >πoomld() == roomjd) return(r- >lbt_servers(mediajbt)); retura(- ERR_BAD_ROOM_ID); int RoomMgr:_LeaveMeeting(CARD32 requester, int meeting id, Lbt_of_p(MediaDesc)& medi Jbt) Room ar; Meeting am; Lbt j of j piterfRoom) riterfroomjbt); riter .resetf); while friter.next(r))f if (r— > hasjneetingO && (m = r- >getjneetingf)) && m— >MeetingId() == meetingjd)! return( m— >leave_meeting(requester, media_lbt)); return(- ERR_BAD_MEETING_ID); int RoomMgr::ReenterMeeting(CARD32 requester, int meeting id, Lbt_ofjp(Med iiaaJD-Jeessc)& media ist) Room ar; Meeting am; Lbt j ofjpiterfRoom) riterfroomjbt); riter .resetf); while (riter.nextfr))! if (r— > hasjneetingO &■&. (m = r- >get_meeting()) && - m— >MeetingId() == meetingjd)! return( m— >reenter_meeting(requester, mediajbt)); retum(- ERR_BAD_MEETING_1D); void RoomMgr::MediaServerDied(int m) MediaServerDied Room ar; Lbt j of piterfRoom) riterfroomjbt); riter .reset(); while (riter.next(r))! room.C room.C r— >MediaServerDied(m); ... MediaServenOied } int RoomMgr JsScrvcrPrescnt(int roomjd, int serverjd) IsServerPresent Room ar; Lbtj>f_piterfRoom) riter(room_lbt); riter .resetf); while (riter-nextfr))! If (r- >RoomId() == roomjd) returnfr— >b_server_presentf serverjd)); returafO); } void RoomMgr:ιAssociatedServersInRoom(int roomjd, Lbt(int)& slbt) List { ' Room ar; Lbt j ofjpiteifRoom) riterfroom_lbt); riter.resetf); while (riter.next(r))( if (r- >RoomId() == roomjd) r— > associated ervers(sιbt); } } int ParticipantInfo::operator==(con3t ParticipantInfo& p) operator { return(participant == p.participant && media_lbt == p.media_lbt); server_reg.C server_reg.C # define DEBUG 1 # define MAX_ARBIT_STRING 500 int INET.ADDR = 1; # include < server jeg.h> # include <commόn-h> Lbt_of pimplementfMediaServerInfo) List of pimplement Lbt _qf_pimplement(MRServerConnInfo) lSt 0j~Ωtmple ment MediaServerInfo:_MediaServerInfo(Media pType, String& pUserDese, MediaServerConn^ pConn, String& plnitializer, Stringϋ. pOtherlnfo) MediaType = pType; UserDese = pUserDese; Initializer = plnitializer; Otherlnfo = pOtherlnfo; Conn = pConn; ServerReg try-ServerRegbtryfMRInterface aifaee, String pjn_file) SβrverRegistry ehar host[HOST_NAME_LEN4-l]; void ServerRegbtry::read_filef) τeαd_file int num entries; ifstream " data__ϊlefin_file, ioβ:πn); int MediaType; - int ch; String UserDese, Machine, header; MediaServerConn Conn; char InitialύerlMAX_ARBIT_STRING], OtherInfo[MAX_ARBIT_STRING]; int Port, StartRange, EndRange, cntl, cnt2; ~ "" MediaServerlnfo apers; MRServerConnlnfo aserv; if ('.data ile) { cout < < "Can't open file " < < in ile; exitfl); // Read default name server datajile > > header; if (header != "NameServer")! server_reg.C server reg.C cout << "NameServer not defined\n"; .readJΛe exitfl); datajile >> name erverjnachine >> name erver_port; // Read MediaServerlnfo data file >> num ntries; for fint i = 0; i < numjntries; i+4-) f data_file > > MediaType > > UserDese > > Conn.conn ype; ■witch (Conn.conn type) { INTEHNET_CONNECTION: data file > > Conn.maehine > > Conn.port > > cntl ; break; GENERIC CONNECTION: default: data file > > Conn .generic > > cntl; break; whileffch = data file.get()) «- " |l ch == V); data ile.putback(cn); data-file.getline(Init_a_izer, cntl+1); data-file >> cnt2; whileffch = data file.get()) == ' ' || ch == \t'); datajιle.ρutback(cn); data_fιle.getline(OtherInfo, cnt24-l); pers-= new MediaServerInfo((Media)MediaType, UserDese, Conn, String(Initializer), StringfOtherlnfo)); #ifdef DEBUG cout << MediaType << " " << UserDese << " " << cntl << " " << Initializer << " " << cnt2 << " " << Otherlnfo << endl; cout.flushO; # endif if (pen) MediaServerLbt.insert_next(pers); // Read MRServerConnlnfo data file >> numjntries; for fi = 0; i < num entries; i4-4-) ! data_file >> " Machine >> Port >> StartRange >> EndRange; serv = new MRServerConnInfo(Machine, Port, StartRange, EndRange); if (serv) MRServerLbt.insert_next(serv); } void ServerRegbtry::LbtAllMediaServerInfo(Lbt j >f_p(MediaServerInfo)& plbt) List_θf_p plbt = MediaServerLbt; } void ServerRegbtry:_LbtAlIMRServer<DonnInfo(Lbt_of_ (MRServerConnInfo)& slbt) List_θf_p slbt = MRServerLbt; } MediaServerlnfo* ServerRegbtry:i.btMediaServerInfo(Media med, String-E key) MediaServerlnfo at; Lbt_of )iter(MediaServerInfo) mlbt(MediaServerLbt); mlbt. resetf); while (miιst.next(t)){ // cout << t->UserDesc: " << t- > UserDese << endl; SLIP SHEET server_reg.C 8erver_reg. C if (t- > MediaType == med && t- > UserDese == key)! ...List of_p retura(t); } } II cout.flushO; return((MediaServerInfo «)NULL); void ServerRegbtry::myjange() my range MRServerConnlnfo as; Lbt_of_piterfMRServerConnInfo) slbt(MRServerLbt); MyStartRange = MyEndRange = - 1; slist.resetf); while fshst.next(s)){ if (s— >Machine == MyName) MyStartRange = s— > StartRange; MyEndRange = s— > EndRange; #ifdef DEBUG cout < < "\nMY RANGE: " < < MyStartRange < < < < MyEndRange < < endl; # endif } int ServerRegbtry:_serverJor_id(int id, String& mach, _nt& port) serveτ_for_id MRServerConnlnfo as; int found = 0; Lbt_of_piter(MRServerConnInfo) slbt(MRServerLbt); endl; void ServerRegbtry::default_namejerverfString& mach, int& port) default _name_server { mach = name j erverjnaehine; port = name_server port; stdin Thu Jan 14 09:52:47 rapport (Sid Ahuja2, 4f601, cript 6.0T Rev. A IP/II, Serial #91:12:17 APPENDIX 3 #i«ndef CM MS β H ♦define -..CMTMSGTH ♦include <asg.h> // Replies from MR class IR_CrβatβRoom : public IncoβingRβply { public: IR_CrβatβRoom<C*RD8 «βg_typ, CARDS asg_eode r int asg_aec__no, int aag_lβn, char •ai data. Connection *invokβr) ΣncomingReply( -nβg_typ, αsg_code,aag eeq o, s_ag_len, ag_data, invoker) 7) void action() ; }; class IRJDestroyRoom : public XneoaingReply { public: IRJDestroyRoom(CARD8 msg_typ, CARD8 msgjsode, int a-sg_3eo j> no, int asg_lβn, char *magj-_ata. Connection "invoker) IncomingRβply( msg_typ, α_ __coe_e,a_sg_aecj ιo, msg_lβn r msgjiata, invoker) T) void action0 I ) ~~ ~~ I; class IR_CreateMeeting : public IncomingRβply { public: IR_CrβatβMββting(CARD8 msg zyp, CARD8 msg_cocJe, int msg_seg_no, int msg_lβn, char *msg_data, Connection *invoker) IncomingRβply( msg_typ, mβg_codβ,asg_aβqjιo, ■ msg_lβn, msgjiata, invoker) Ti void action() ; ~ J; class IRJDestroyMeeting : public IncomingRβply ( public: IRJDestroyMeeting(CARD8 msg_typ, CARDS msg j eode, int msg_seq_no, "" int msg_lβn, char *msg_da a. Connection *invoker) IncomingRβply( msg_typ, msg_coclβ,m3g_sβq_no, msg_lβn, ιnsg_da a, invoker) {} void action0 {} >; class IR_AddServer : public IncomingReply { public: IR__AddServer(CARDS msg_typ, CARD8 msg_codβ, int msg_seq_no, ~ int msg_len, char •βsg data. Connection » invoker ) IncomingRβply( msg_typ, msg_codβ,msg_seoijιo, msg_lβn, msgjiata, invoker) {} void action0 ; .; class IR_DropServer : public IncomingRβply { public: IR DropServβr(CARD8 msg_typ, CARD8 msgjsodβ, int msg_sβq_no, ~ "" nt msg len, char *msg_data. Connection *invoker ) IncomingRβply( msg_typ, msg_codβ,ιnsg_seoχjιo, msg_len, msg_da a, invoker) {} }; class IR_λddParticipant : public incomingReply I public: IR AddParticipan (CARD8 msg_typ, CARD8 msg_code, int asg_se<L_no, ~ int msg_len, char * msg_άata f Connection "invoker ) IncomingReply( msg ryp, msg_code,msg_seq_no, msg_len, msg_data, invoker) {1 class XR_DropParticipant : public IncomingReply ( public: IRJJropParticipant(CARD8 msg_typ, CARDS asgjjodβ, int msg_sβq_no, int msg__l β n7 char *___sg_da a, Connection *invoker) IncomingReply( msg_typ, msg_codβ,mag_3βq_no, msg_len, msg data, Invoker) T) }; ~ class IR_I_istRooms : public IncomingReply ( public: IR_ istRooms(CARD8 msg_typ, CARD8 msg_code, int msg__sβq_no, int msg_len, char *mag_da a, Connection *invoker) IncomingReply( msg ÷yp, -aβg_codβ,mβg_s*q_no, msg_len r msg_data, invoker) (} void action() ; ); class IR_IιistMeetings : public IncomingRβply { public: IR_L ' istMβetings(CARD8 msg_typ, CARD8 msg_code, int msg_sβq_no, int msg_len, ehar *msg_data, Connection *invoker) IncomingReply( msg_typ, msg_codβ,π-sg_secj_no, msg_len, msg_ό_ata, invoker) ( } void action() ; ); class IR_ istServers : public IncomingReply { public: IR_ListSβrvβrs(CARD8 msg_typ, CARD8 msg_code, int msg_seg_no, int msg_lβn, char *msg_data, Connection *invoker) IncomingRβply( msg_typ, msg_codβ,-__sg_sβq_no, msg_len, msg_data r invoker) (} void action() ; }; class IR_LeaveMeeting : public IncomingReply { public: IR_LeaveMeeting(CARD8 msg_typ, CARD8 msg_code, int msg_seq_no, int msg_len, char *msg_data, Connection *invoker) IncomingReply( msg_typ, msg_codβ,msg_seg__no, msg_len, sg data, invoker) (} }; class IR_ReenterMeeting : public IncomingReply { public: IR_ReenterMeeting(CARD8 msg_typ, CARD8 msgjiode, int msg_secj_no, int msg_len, char *msg_data, Connection *invoker ) IncomingRβply( msg_typ, msg_code,msg_seg_no, msg__len, msg_data, invoker) {} }; class IR_SuspendMβeting : public IncomingReply { public: IR SuspendMeeting(CARD8 msg typ, CARDS msg_code, int msg_seq_no, ~ ~ int msg_len, char *msg_data. Connection *invoker IncomingReply( msg_typ, msg_code,msg_seq_no, msg_len, msg_data, invoker) () }; class IR_ResumeMeeting : public IncomingReply { public: IR ResujneMeeting(CARD8 msg_typ, CARD8 msg_code, int msg_seq_no, ~ int msg_len, char *msg_data, Connection *xnvoker IncomingReply( msg_typ, msgj:ode,msg_3eq_no. msg_len, ιnsg_data, invoker) {) ); class ΣR_GetPβrsonlnfo : public IncomingReply { public: IR_GβtP β rsonInfo(CARDS msg_typ, CARD8 msg_eodβ, int msgjsβqjio, int msg_lβn, char *msg iata, Connection *invok IncomingRβply( msg zyp, msg_codβ,___sg_seq_no, msg_lβn, msg_data, invoker) 7) void action() ; }; class IR_ShovMeetingStatus : public IncomingReply { public: IR_ShovMeetingStatus(CARD8 msg_typ, CARDS msg__codβ, int msg_seq_no, int msg_len, char *msgjdata, Connection *invok IncomingReply( msg_typ, msg_codβ,msg_seq_no, msg_len, msg_data, invoker) T) void action0 ; }; class IR_ShovMeetRoomStatu3 : public IncomingReply { public: IR_ShowMeetRoomStatus(CARD8 msg_typ, CAR 8 msg rode, int msg_seq_.no, int msg_len, char *msg_data, Connection *invok IncomingReply( msg_typ, msg_code v msg_seg_no r msg_len, msg_data, invoker) {} void action() ; " ~ i; class IR_VIMeetingInvitation: public IncomingReply { public: IR_VIMββtingInvitation(CARD8 msg_typ, CARD8 msg_eode, int msg_seq_no, int msg_len, char *asg_data, Connection *invok IncomingReply( msg_typ, msg_coαe r msg_seg_no, msg_len, msg_data, invoker) {} void action() ; ) I X 11111111111 II 111 EVENTS from VI class IE_EveCreateMeeting : public IncomingEvent { public: IE_EveCreateMeeting(CARD8 ι__sg_typ, CARD8 msg__code, int msg_seq_no, ~ int msg_len, char *msg_data, Connection *invo IncomingEvent( πιsg_typ f msg_code,msg_seq fc _no, msg_len, mβgjiata, invoker) {1 void action() ; }; class IE_EveCreatβPβrsistentMeeting: public IncomingEvent { publi : IE EveCreatePersistentMeeting(CARD8 msg_typ, CARD8 msg_code, int msg_seg_no, ~ int -nsg_len, char *msg_data, Connection *invo IncomingEvent( msg__typ, msg_code,msg_seg_no, msg_len, msg_data, invoker) {} void action() ; ); class IE_EveVICreateMeetIn£Room: public IncomingEvent { public: IE EveVICreateMeetlnERoo (CARD8 msg_typ, CARD8 msg_code, int msg_seq_no, ~ int msg_len, char »msg_data, Connection *invo IncomingEvent( msg iyp, π-sg_code,msg_seqjιo, msg_len, msg_data, invoker) { 1 void actio () ; ); class IEJBveVIAddParticipant: public IncomingEvent ( public: IEJBveVIAddParticipant(CARDS msg__typ r CARD8 sg j ∞dβ, int msg_seq_no, int msg_lβn, char *msg _ata. Connection «invok IncomingEvent( aβg_typ, msg_codβ,-__sg_seq_no, msg_len, msg_data, invoker) (} void action(); ~ ); class IE_EveVIDropParticipant : public IncomingEvent { public: — IE_EveVTDropPar icipant(CARDS msg_typ, CARD8 msg_codβ, int msg_seq_no, Int msg_lβn, ehar *msg_data. Connection *invok IncomingEvent( msg_typ, msg_codβ r mag_seq_.no, msg_lβn, msgjiata, Invoker) {} void action() ; 1; class IE_ΞVeVISuspendMeeting : public IncomingEvent ( public: ~ " IEJBveVXSuspendMeeting(CARDS msg__typ, CARD8 msg_code, int msg_seq_no, int msg_Len, char *msg_data, Connection *invok IncomingEvent( msg_typ, msg_codβ,msg_seq_no, msg_len, msgjdata, invoker) {} void actio () ; ); class IE_EveVIResumeMeeting : public IncomingEvent ( public: lE EveVIResumeMeeting(CARD8 msg_typ, CARD8 msg_codβ, int asg_seq_no, int msg__len, char *msg_da a, Connection *invok IncomingEvent( msg_typ, msg_eodβ,msg_seq_no, msg_len, msgjiata, invoker) {) void actio () ; }; class IE_EveVIReenterMeeting : public IncomingEvent ( public: IE_EveVIReenterMeeting(CARD8 msg_typ, CAR 8 msg_code, int msg_seq_no, int msg_len, char *msg_data, Connection *invok IncomingEvent( msg_typ, msg_code,msg_seq_no, msg_len, msg_data, invoker) {1 void action0 ; }; class IE_EveVII*aveMeeting : public IncomingEvent { public: IE EveVILeaveMeeting(CARD8 sg_typ, CARD8 msg_code, int msg_seq_no, int msg_len, char *msg_data, Connection *invo IncomingEvent< xnsg_typ, msg_code,msg_seq_no, msg_len, msg_data, invoker) {} void action0 ; 1; class IE_EveVIAddServer : public IncomingEvent { public: IE EveVIAddServer(CARD8 msg typ, CARDS msg_code, int msg_seq_no, ~ "" int msg_len, char *msg_data, Connection *invo IncomingEvent( msg_typ, msg_code,msg_seqjιo, msg_len, msg_data, invoker) {} void action() ; }; class IE_EveVIDropServer : public IncomingEvent ( public: XE_Ev β VIDropS β rver ( CAKD8 ___eg_typ, CARD8 βsg_codβ, int msg_seq_no, int msg_lβn, char •msg data. Connection *invok IncomingEvent ( n_sg__typ, msg_code,msg_seq_no, msg_len, msg_data, invoker) (} void actionO; 1; class IE_EveVXDestroyHeeting : public IncomingEvent { public: IEJSv β VID β stroyM ββ ting(CARDS msg_typ, CAR 8 msg_eodβ, int msg_sβq_no, int msg_len, char *msg_data, Connection *invok IncomingEvent( msg_typ, msg_code f sg_seq_no, msg_len, msg_data, invoker) {} void action() ; ); class IE_EveVIListRooms : public IncomingEvent { public: IE_EvθV ListRooms(CARD8 msg_typ, CARD8 msg_eodβ, int msg_seq_no, int msg_lβn, char *msg_da a, Connection *invok IncomingEvent( msg_typ,~msg_codβ,msg_sβq_no, msg_len, msg_data, invoker) T) void action() ; }; class IE_EveVXListMeetings : public IncomingEvent { public: IE_EvβVX istMββtings(CARD8 msg_typ, CARD8 msg_code, int msg_seq_no, int msg_len, char *msg_data, Connection *invok IncomingEvent( _nsg_typ, msg_code,msg_seq_no, msg_len r msgjiata, invoker) {} void action() ; } class IE_EveVISho%rMeetingStatus : public IncomingEvent { public: IE_EveVIShowMeetingStatus(CARD8 msg_typ, CAR 8 msg_code, int msg_seq_no, int msg__len, char " *msg_data, Connection *invok IncomingEvent( msg_typ, msg_codβ,msg_seq_no, msg_len, msg_data, invoker) { J void action() ; }; class E_EveVIShowMeetRoomStatus : public IncomingEvent { public : IE_EveVI S howMeetRoomStatus (CARDS msg_typ, CARD8 msg_code, int msg_seq_no, int msg len, char *msg_data. Connection "invok IncomingEvent ( msg_typ, msg_code,msg_seq_no, msg_len, msg_data, invoker) ( } void action () ; } ; class IE_EveVIJoinMeeting : public IncomingEvent { public: IE EveVIJoinMeeting(CARD8 msg_typ, CARDS msg_codβ, int msg_seq_no, ~ int msg_len, ehar *msg_data. Connection *invok IncomingEvent( msg_typ, msg_codβ,msg_seqjιo, msg_len, msg_data, invoker) {} void action() ; }; class IE_EveVIJoinMeetingRejected : public IncomingEvent { public : IE Eve V IJoinMeetingRejecte (CA R D8 msg_typ, CARD8 msg_code, int msg_seq_no, ~ int msg_len, char *msg_data, Connection *mvo IncomingEvent ( msg tsrg, msg_code,msg_seq_no, msg_len, msg_data, invoker) {} void action() ; ); class IE_EveVXJoinMaeting*ecepted : public IncomingEvent { public: XE_EveVXJoinMeetingAccepte (CARDS msg_typ, CARD8 msg_codβ, int msg_seq_no, int msg_len, char *asg_data, Connection "invok IncomingEvent( msg typ, msg_code,msg_seq_no, msg_len, msgjiata, invoker) {) void action() { ) }; class IEJBveVlGetPersonNaae : public IncomingEvent { public: 2E_EveVXGetPersonNaα_e(CARD8 msg_typ, CARD8 msg_codβ, int msg_sβq_no, int msg_len, char *msg ta, Connection *invok IncomingEvent( msg_typ, msg_code,msg_seq_no, msg_len, msgjdata, Invoker) {) void action() {) }; class lEJSveVΣGetPersonlmage : public IncomingEvent { public: IE_EveVIGetPersonImage(CARD8 msg_typ, CARD8 msg_codβ, int msg_seq_no, int msg__len, char *msg_data, Connection » invok IncomingEvent( π_sg_typ, msg j eode,msg_seq_no, msg_len, msg_data, invoker) (} void action() {} }; class IE_EveVXGetPersonId : public IncomingEvent { public: IE_EveVXGetPersonId(CARD8 msg_typ, CARD8 msg_eode, int msg_sβq_no, int msg_lβn, char *msg_data, Connection *invok IncomingEvent( msg_typ, msg_code,msg_seq_no, msg_len, msg_data, invoker) { ) void action() {} }; class IE_EveVTUρ : public IncomingEvent { public: IE_EveVIϋp(CARD8 msg_typ, CARD8 msg_eode, int msg_seq_no, int msg_len, char *msg_data, Connection *invok IncomingEvent< msg_typ, msg_code,msg_seq_no, msg_len, msgjiata, invoker) {} void action() {} 1; class IE_EveVIDown : public IncomingEvent { public: IE EveVΣDown(CARD8 msg typ, CARD8 msg_code, int msg_seq_no, — " ~ int msg_len, char *msg_data, Connection *invo IncomingEvent( msg_typ, msg_code, sg_seqjιo, msg_len, msg_data, invoker) {J void action() ; }; class IE_EveVIShowAssocRoom: public IncomingEvent { public: IE EveVIShowAssocRoom(CARD8 msg typ, CARD8 msg_code, int msg_seq_no, ~ ~int msg_len, char *msg_data. Connection *invo IncomingEvent( msg_typ, msg_code,π_sg_seq_no, msg_len, msg_data, invoker) I } void action0 { } 1; //////////////////// EVEHTS from EH class IE_EvβMββtingInvite : public IncomingEvent { public: IE_Ev β M ββ tingInvitβ(CARD8 msg_typ, CARD8 msg_code, int msg_sβq_no, int msg_len, char *msg_d_ata, Connection *invok IncomingEvent( msg_typ, msg_code,msg_seqjιo, msg_len, msgjdata, Invoker) 7} void action{) ; }; class IE_EveAcceptInvitation : public IncomingEvent ( public: IE_EveAcceptInvitation(CAR 8 msg_typ, CARD8 msg_code, int msg_seq_no, int msg_lβn, char *msg_da a, Connection *invok IncomingEvent( msg_typ, msg_codβ,msg_sβq_no, msg_len, msg_data, Invoker) 7} void action() ; ); class IE_EveRejectInvitation : public IncomingEvent { public: IEJSveRe ectlnvitation(CAR 8 msg_typ, CARDS msg_code, int msg_seq_no, int msg_len, char *msg_data, Connection *invok IncomingEvent ( msg_typ, msg_code,msg_seq ιo, sg_len, msg_data, Invoker) 7) void action() ; }; class IE_EveJoinMββting : public IncomingEvent ( public: IE_EveJoinMeeting(CARD8 msg_typ, CARD8 zBsg_code, int msg_seq_no, int msg_len, char *msg j data. Connection *invok IncomingEvent ( msg_typ, msg_code,msg_seqjιo, msg_len, msg_data, invoker) {} void action() ; ); class IE_EveJoinMeetingRejected : public IncomingEvent { public: IE_EveJoinMeetingRejected(CARD8 msg_typ, CARD8 msg_code, int msg_seq_no, int msg_len, char *msg_data. Connection *invok IncomingEvent ( msg_typ, msg_codβ f _nsg_seq_no, msg_len, msgjdata, invoker) {) void actio () ; }; class IE_EveRoomDβstroyed: public IncomingEvent { public: IE_EveRoos_Destroyed(CARD8 msg_typ, CARD8 msg_code, int msg_seq_no, int msg len, "" char *msg_data, Connection *invok IncomingEvent( msg_typ, msg_code,msg_seq_no, msg_len, msg_data, invoker) {} void action0 ; }; class IE_EveMeetingDestroyed: public IncomingEvent { public: IE EveMeetingDestroyed(CARD8 msg_typ, CARD8 msg_code, mt msg_seq_no, — int msg_len, char *msg_data, Connection *mvo IncomingEven ( msg_typ, m3g_code,m3g_seq_no, msg_len, _nsg_data r invoker) {} void action() ; }; class IE_EveAddedParticipant : public IncomingEvent ( public: IE_Ev β Add β dParticipant(CARDS msg__typ f CARD8 msg_codβ, int msg_seq_no, int msg_len, char *msg_data. Connection *invok IncomingEvent( msg_typ, -_-βg_code,asg_seq_.no, msg_len, msg_data, Invoker) 7. void action(); ); class lEJSvβDroppedParticipant: public IncomingEvent { public: IE_EveDropp β dParticipant(CARD8 msg_typ, CARDS msg_codβ, int msg_seq_no, int msg_len, char~ « magjia a, Connection *invok IncomingEvent( msg_typ, msg_code,asg_seq_no, msg_len, msg_data, invoker) {) void action() ; ~ ); class IE_BveRoomI_ocked : public IncomingEvent ( public: IE_EveRoomI_ocked(CARD8 msg_typ, CARD8 msg_code, int msg_seq_no, int msg_len, char *msg_data. Connection *invok IncomingEvent( msg_typ, msg_code,msg_seq_no, msg_len, msgjiata, invoker) {} void action() { } ~ ); class IE_EveRoomDnlocked: public IncomingEvent { public: IE_EvβRoomOnlocked(CARD8 msg_typ, CARD8 msg_code, int msg_seq_no, ~ * int msg_len7 char *msg_data. Connection *invok IncomingEvent( msg typ, msg_codβ,msg_seq_no, msg_len, msgjdata, invoker) {) void action() {} ); class IE_Eve eftMeeting : public IncomingEvent { public: IE_Eve eftMeeting(CARDS msg_typ, CARDS msg_code, int msg_seq_no, — int msg len, char *msg_data, Connection *invok IncomingEvent( msg_typ, msg_code,msg_seq_no, msg_len, msg_data, invoker) {) void action() ; }; class IE_EveReenterMeeting: public IncomingEvent { public: IE EveRββntβrMeeting(CARD8 msg_typ, CARDS msg_code, int msg_seq_no, int msg len, char *msg_data, Connection *invok IncomingEvent( msg_typ, msg_code,msg_seq_no, msg_len, msg_data, invoker) {} void action() ; 1; class IE_EveMeetingSuspended: public IncomingEvent { public: IE EveMeetingSuspended(CARD8 msg_typ, CARD8 msg_code, mt msg_seq_no, ~ int msg_len, ehar *msg_data, Connection * vo IncomingEvent( sg_typ, msg_code,msg_seq_no, msg_len, msg_data, invoker) {} void action() ; }; class IE EveMeetingResumed: public IncomingEvent { public: IE_Ev β Me β tingR β suβed(CARD8 msg_typ, CARD8 msg_code, int msg_sβq_no, int msg_len, char "msgjiata. Connection "invoke IncomingEvent( msg_typ, msg_code,msg seq j ao, msg_len, msg_data, invoker) 7} void action() ; - J; class IE_EveServerAdded : public IncomingEvent { public: IE_EveS β rverAdded(CARD8 msg_typ, CARD8 msg_code, int msg_seq no, int msg_len, char *msg_data. Connection *invoke IncomingEvent( msg_typ, msg_codβ,8.sg_seq no, msg_len, msg_data, Invoker) {} void action(); ); class IE_EveServerDropped : public IncomingEvent ( public: — IE EveServerDropped(CARD8 msg_typ, CARD8 msg_eode, int msg_seq_no, int msg_lβn, char "msgjiata, Connection "invoke IncomingEvent( msg_typ, msg_codβ,msg_seq_no, msg_len, msgjiata, invoker) {} void action() ; ); class IllegalMessage: public IncomingRequest { public: IllegalMessage(CARD8 msg_typ, CARD8 msg_code, int msg_seq_no, int msg_len, char "msgjiata. Connection "invoker) : IncomingRequest(msg_typ, msg_code, msg_sβq_no, msg_len, msgjiata, invoker) { } void action() {} J; // Events from Local Media Managers class lE_EveLMUp: public IncomingEvent { public: IE_EveLMUp(CARD8 msg_typ, CARD8 msg_code, int msg_seq_no, int~msg_lβn, char *msg_data, Connection "invoke IncomingEvent( msg_typ, msg_code,msg_seqjιo, msg_len, msg_data, invoker) {} void action() ; }; class IE_EveLMStateChange : public IncomingEvent { public: IE EveLMStateChange(CARDS msg_typ, CARD8 msg_code, int msg_seq_no, int msg_len,~char *msg_data. Connection "invoke IncomingEvent( msg_typ, msg_codβ,msg_seq_no, msg_len, msg_data, invoker) {) void action() ; }; ♦endif ♦ifndef COMMON_H ♦define COMMON_H 1 ♦define HOLMDEL 1 ♦ifdef HOLMDEL ♦include <sys/types.h> ♦include <sys/tiffle.h> ♦include <netdb.h> //For struct hostenj. »include <syβ/socket.h> //ror A_r_H0BT ♦include <ec/netinet/in.h> //ror struct in addr ♦include <arpa/inβt.h> //For inβt_ntoa- ♦dβfinβ USHORT u short ♦endif class Controller; class Protocol; class Connection; class LocalMedia; class MRServer; class EventNotifier; class Visuallnterface; class CoanQbjMgr; class MRServerManager; class LocalMediaManager; class EventNotifierManager; class VisualInterfaceManagβr; class RoomFsm; class Conferee; class RoooFss-Mgr; class Convert; class Message; ♦define HOST_NAME_LEN 1024 ♦define DJMMX_STR_SIZE 1024 ♦include <Mm/MmNetworkMan.h> ♦include <Ma_/Me__Enum.h> ♦include <Mm M_- onnection.h> ♦include <FE_typβs.h> ♦include <convert.h> ♦include <List.h> ♦include <String.h> ♦include <Block.h> ♦include <pcρp/pString.h> ♦include <iostream.h> ♦include <fstream.h> ♦define NW (MmNetvorkManager: :NetworkManager() ) Listdeclare(int) ♦define ROOM_UNASSIGNED -1 ♦define TRANSIENTJMEETING 0 ♦define PER≤ISTENT_MEETING 1 ♦endif ♦ifndef C0NN_H ♦define CONNJϊ 1 ♦define INIT_MAX_BOFI_EN 65536 ♦include <cont roller. h> ♦include <obj_man.h> ♦include <coπmon.h> Blockdeclare (char) This is the base class for all coπαπunication objects . It maintains the communication state (MmConnection object ) . enum ConnectionObjectTypes { e_MR, e_EN, e_LM, e_VI } ; class Connection { public: Connection(Controller "Ctrl, MmConnection pconn, ConnectionObjectTypes otypβ) ; -Connection() ; MαConneetion connectio () { retur (conn) ; } int send(char "data, int len); int send(Message *msg) ; Controller *Control() { retur (Ctrl) ; } int is_alivβ() ( return(alive) ; ) RoomFsmMgr "RoomManagβr() { return(Ctrl->RoomManage ()) ; ) void deactivate_sel () { client_dead() ; ) void servicedjnsg(Message "msg) { delete msg; } virtual void processjnsgO " 0; ConnectionObjectTypes object_type() { return obj_type; ) protected: void cliβnt_process_msg() ; void client jieadO ; int alive; ConnectionObjectTypes obj_type; Controller *Ctrl; char header [MSG_HEADER_LEN] ; static int header_len; Bloc (char) buf; ~ MmConnection conn; }; enum LocalMβdiaStatβ { β_LM_INACTIVE, e_LM_ACTXVE ); class LocalMedia : public Connection { public: LocalMedia(Controller "Ctrl, MmConnection pCIi) : Connection(Ctrl, pCIi, e_LM) { ___edia_state - e LM_ACTIVE; } void processjnsgO { cliβnt_process_msg ( ) ; } Media getjnedia Q ( return m; } String get_udesc () { return udesc; } int is jnatch (Media p_m. Strings p_udesc) . int tap - (udesc — p_udesc) ? 1 : 0; return ( (tmp 6& (m — p_m) ) ? 1 : 0) ; } int is jnatch (Media p m) { return ( (m — p_m) ? 1 : 0) ; } void update (Media pjned, Strings pjαdesc) i m - p j ned; pjidesc - udesc; ) LocalMediaState state () { return media_state; } void set active 0 { media_state - e_LM_ACTIVE; } void set~inactive () ( med a_state - e_LM_INACTIVE; } private : Media m; String udesc; L ocalMediaState π-edia_state ; ) ; class MRServer : public Connection { public: MRServer ( Controller "Ctrl, MnConneetion pCIi) : Connection(Ctrl, pCIi, e MR) {) void processjns O { client procβssjnsg(7; ) i ; class Visuallnterfaee : public Connection { public: Visuallnterfaee (Controller *etrl, MmConnection pCIi) : Connection(Ctrl, pCIi, β VT) {) void processjnsgO { client_procβssjnsg(7; ) J; class EventNotifier : public Connection { public: EventNotifier ( Controller "Ctrl, MmConnection pCIi) : Connection(Ctrl, pCIi, e_EN) {} void process msgO { client_ρrocβss msg() ; ) }; ♦endif ♦ifndef CONTROLLERJl ♦define CONTROLLER_H~ 1 ♦include <proto.h> ♦include <msg.h> ♦include <ports.h> void CM_shutdown() ; class Controller { public: Controller() (); -Controller() ; // Parse and line arguments, create other objects in the system virtual void startup(int argc, char *argv[]); // an infinite loop with a select statement (default polling on four // ports. When a message arrives in one of these ports, // the corresponding objects manager's processing method is invoked, virtual void main_loop(); // Starts four listening ports - one for the VI and three for the // local media managers virtual void liste (); // Sets the listening port for the MRServer. To be effective, this method // should be invoked before listen() is invoked, void sβt_VT_port(int port) ( VI_port - port; . // Sets the listening port for the local media managers. To be effective, // this method should be invoked before listen() is invoked , void set_LocalMediaPort(int port) ( LM_port - port; ) // Returns the listening port where the VI connects int VIPort { return VI_port; ) // Returns the listening port where the local media managers connect int LocalMediaPortO { return LM_port; } // Handle for the RoomManager object RoomFsmMgr "RoomManager() { retur (RMgr) ; } String MyNaa_e() { return my naaw; } int MyldO ( return βy_id; 7 // Handle for the Protocol object Protocol *Proto() ( return(Prot); ) // Handle for the Convert object (which is used for network to host // conversion and vice versa. Convert •Ce«r() { return(ConvMβthods) ; } MRSβrvβrManager* MRMgr() { return MRMgr; ) EvβntNotifiβrKanagβr* ENMgrO { return _ENMgr; } LocalMβdiaManagβr* LMMgrO . return LMMgr; } Visuallnt β rfac β Manager* VΣMgrO I return VTMgr; ) protected: Protocol *Prot; Convert "ConvMβthods; RooaFsaMgr "RMgr; MRServerManager *_MRMgr; EventNotifiβrManager *_ENMgr; LocalMediaManager "_LMMgr; VisuallnterfaceManager *_VTMgr; String MRjnachine; String ENjnachine; int MR_port; int EN port; int VT_port; int LM_port; int ay_id; String my name; 1; ♦endif ♦ifndef ___GENERATOR_H ♦define GENERATOR~H 1 ♦include <msg.h> ♦include <cm_msg.h> /* prototypes of the functions which create message objects */ IncomingMessage "default generator( CARD8, CAR 8, CARD32, CARD32, char *, Connection *) IncomingMessage "Gβn_ErrMsg( CARD8, CARD8, CARD32, CARD32, char *, Connection *) ; IncomingMessage *Gβn_IR_CreateRoom( CARDS, CARD8, CARD32, CARD32, char *, Connection ") IncomingMessage *Gβn_IR_DβstroyRoom( CARD8, CARD8, CARD32, CARD32, ehar *, Connection * IncomingMessage *Gβn~IR_CrβatβMeeting( CARD8, CARD8, CARD32, CARD32, char ", Connection IncomingMessage *Gen_IR~DestroyMeeting( CARD8, CARD8, CARD32, CARD3-., char *, Connectio IncomingMessage *Gβn_IR_λddSβrver( CARD8, CARD8, CARD32, CARD32, char *, Connection *) ; IncomingMessage *Gen_IR_DropSβrver( CARD8, CARD8, CARD32, CARD32, char *, Connection * ) IncomingMessage *Gen_IR_AddParticipant( CARD8, CARD8, CARD32, CARD32, char *, Connectio IncomingMessage *Gen~IR_DropParticipant( CARD8, CARD8, CARD32, CARD32, char *, Connecti IncomingMessage *Gen~IR ListRooms( CARD8, CARD8, CARD32, CARD32, char *, Connection * ) ; IncomingMessage *Gen~IR_ListMeetings( CARD8, CARD8, CARD32, CARD32, char *, Connection IncomingMessage *Gen~IR ListServers( CARD8, CARD8, CARD32, CARD32, char *, Connection * IncomingMessage *Gen~IR_LeaveMβeting( CARD8, CARD8, CARD32, CARD32, char ", Connection IncomingMessage *Gen IR_ReenterMeeting< CARD8, CARD8, CARD32, CARD32, char *, Connectio IncomingMessage *Gen "" lR_SuspendMeeting( CARD8, CARD8, CARD32, CARD32, char *, Connectio IncomingMessage *Gen_IR_ResumeMeeting( CARD8, CARD8, CARD32, CARD32, char *, Connection ∑nceαinølessage •G β n_ΣRjSet» β *aonXn*o ( CARDS, CARDS, CAFD32, CARD32, char ", Connection Xaco iiφleasage *Oen πi_3ho-leeting β tatus( CARDS, CARDS, αuβ32, CARD32, chir " connec lncne.ing-ee.19e •Gen_IK_Shen_llaetRooαStatue( CARDS, CARDS, CARD32, CARD32, char ", Connec ■ _XR_VWeetingΣnvitation< CARDS, CARDS, CARD32, CARD32, char Conne IncoEi-ngMeesage .XB .BveCxeataMeeting( CARDS, CARDS, CARD32, CARD32, char *, Connecti ineoaingMeasage _XE " .BveCreatePeraiatentM β eting( CARDS, CARDS, CARD32, CARD32, ehar * XneomingMeesage •Gen .«**VXCr β ateM β etInBRooα( CARDS, CARDS, CARD32, CARD32, ff her ", Co IncomingMessage •Gen] XX„BveVXShoι_MeetRooaStatus< CARDS, CARDS, CARD32, CARD32, char ", C XneoαingMsssage •Gen " ΣE ' EveVXShoiMeetingStatus( CARDS, CARDS, CARD32, CARD32, char ", Co IncoaingMasaage •Gen ' " XB " EveVXJoinMeeting( CARDS, CARDS, CARD32, CARD32, char ", Connecti XneααiagMeasage •Gen. *.BveVZAddParticipant( CARDS, CARDS, CARD32, CARD32, ehar *, Conne IneoaingMassage •Gen ' XB BveVXDropParticipant( CARDS, CARDS, CARD32, CARD32, char ", Conn IncoaingMβaaage •Gen ' XE " EvoVISuapondHaating( CARDS, CARDS, CARD32, CARD32, char ", Conne IneoaingMeasage *Gβn_ IB.BveVXResumaHseting( CARDS, CARDS, CARD32, CARD32, ehar ", Connec IneoaingMassage •Gen. ΣE " BveVXReenterMeeting( CARD8, CARDS, CARD32, CARD32, char ", Conne IncoaingMasaage •Gen " " IE " EveVXLeaveMeeting( CARDS, CARDS, CARD32, CARD32, char *, Connect IncααingMesβage •Gen "' XB " EveVIAddSβrv β r< CARDS, CARDS, CARD32, CARD32, char •, Connection IncoaingMasaage •Gen " ΣB " BveVXDropServer( CARDS, CARDS, CΛRD32, CARD32, char ", Connectio IneoaingMeasage *Gβn_ΣB " SveVXDeatroyRooa( CARDS, CARD8, CARD32, CARD32, ehar *, Connecti IncomingMessage "Gen " ΣE " BveVXDestroyMeeting( CARD8, CARDS, CARD32, CARD32, ehar *, Conne IneoaingMassage •Gen " ΣE " EvβVX istRooαs( CARDS, CARD8, CARD32, CARD32, char *, Connection IneoaingMassage •Gen " ΣE " BveVXListMeetings( CARDS, CARD8, CARD32, CARD32, ehar *, Connect IneoaingMassage •Gβn_ΣE " EveVXGetPersonNaae( CARDS, CARDS, CΛRD32, CARD32, ehar *. Couaee IneoaingMassage •Gen " IE " BveVXGβtPβrsonΣaaga( CARD8, CARDS, CARD32, CARD32, char *, Conne IncomingMessage •Gen " ΣB " EveVXGetPersonXd( CARDS, CARDS, CARD32, CARD32, char *, Connecti IncomingMessage •Gβn_ΣB " EveVXOpi CARD8, CARDS, CARD32, CARD32, ehar •, Connection •); IneoαingMaasage •Gen " ΣB " EveVTDown( CARDS, CARDS, CARD32, CARD32, char ", Connection *) ; IneoaingMassage •Gen " ΣB " EveVXShowAssocRooat CARDS, CARDS, CARD32, CARD32, ehar *, Connec IneoaingMassage •Gen_ * ΣB " BveV JolnMaetingAeeepte ( CARDS, CARDS, CARD32, CARD32, ehar ", IneoaingMassage •Gen " ΣB " EveVIJoinMeetingRejecte ( CARDS, CARDS, CARD32, CARD32, ehar ", XneoaingMessage •Gen. ΣB E-eMeetingΣnvite( CARDS, CARDS, CARD32, CARD32, ehar ", Connecti IneoaingMassage •Gen "" πt~EveAecβptInvitatio ( CARDS, CARDS, CARD32, CARD32, ehar *, Conne IncomingMessage •Gen "" ∑E~BveRejectΣnvitation( CARDS, CARDS, CARD32, CARD32, char *, Conne IncomingMessage •Gen '" ∑E~EvβSβrvβrAddβd( CARD8, CARDS, CARD32, CARD32, char ", Connection IneoaingMassage •Gen " ~ΣE~ " EveServerDropped( CARD8, CARDS, CARD32, CARD32, char ", Connecti IncomingMessage •Gen "" ∑E~BveJoinMeeting( CARDS, CARD8, CARD32, CARD32, ehar ", Connection IncomingMessage •Gen..ΣE_EveJ θ inMββtingRβjβCtβd( CARD8, CARDS, CARD32, CARD32, char *, Co IncomingMessage •Gen. ΣB_BveRooαDestroyed( CARD8, CARD8, CARD32, CARD32, char ", Connecti IncomingMessage •Gen " ~ΣB BvaHaatingPes roye ( CARDS, CARD8, CARD32, CARD32, char ", Conne IncomingMessage •Gen " "∑B~BveAddβdParticipant( CARDS, CARDS, CARD32, CΛRD32, char ", Conne IncomingMessage •Gen " "∑ETEveDroppβdParticipant( CARDS, CARDS, CARD32, CARD32, ehar » , Con IncomingMessage •Gen~ΣE "" BveRooaLoeked( CARD8, CARDS, CARD32, CARD32, char *, Connection IncomingMessage •Gen"lB~EveRo C -__Dnlockβd( CARD8, CARD8, CARD32, CARD32, ehar ", Connectio IncomingMessage •Gen"∑B~BvβlβftMeβting( CARD8, CARDS, CARD32, CARD32, char *, Connection IncomingMessage "lB~BveReenterMeeting( CARDS, CARD8, CARD32, CARD32, char *, Connect IncomingMessage "∑B~BveHeetingSuspende ( CARD8, CARD8, CARD32, CARD32, char *, Conne IncomingMessage "∑B~BveMeetingRβsume ( CARD8, CARD8, CARD32, CARD32, char *, Connect IncomingMessage •Gen. ■* ΣB""BveI_MStatβChangβ( CARDS, CARDS, CARD32, CARD32, char « , Connect IneoaingMassage •Gen"∑E~EveX_Mσp( CARD8, CARD8, CARD32, CARD32, char *, Connection *>; ♦endif ♦ifndef IOC H ♦de ine IOC_H__ ♦define MEDIAJJNSET 0 ♦define MEDIA SET 1 ♦include <systβm_proto.h> ♦include <FE_typβs.h> ♦include <String.h> ♦include <List.h> struct MadtiaBrldgaPosc ( String udesc; ' String aaehine; int port; int req_doae; int active; /• int operator--(const MadiaBridgeDeses p) return (a — ■ p.a tt udeac —- p.udβac); •/ ); List_of_pdeclare(MadiaBridgaDese) class MβdiaBridgeDβscList ( public: . βdiaBridgβDeβcLiβt() ; -MediaBridgeDβscList(); // copy constructor MediaBridgeDescList(const MediaBridgeDescLists rhs) ; // assign constructor MediaBridgeDescLists operator-(const MediaBridgeDescLists rhs); int length() { return (list.length()); ) int nuB_yet_to_sβrvicβ() ( return (yet_to_aβrvieβ); ) int nextJ8ridgo_to_aorvice(ModlaBridgeDaac«S bridge); void addTMedia a, Strings user dese); void add(MediaBridgβDβacs med)7 void reaove(Media a); void update(Media a. Strings machine, int port, int is_aetive - 0); void uρdatβ_prev_requβst(Strings machine, int port, int is_active); void up_ate_aρpileable aedia(MediaBridgeDescLists adesc); int is_preβent(MediaBrldgeDesc *b); List_of_p(MadiaBridgeDese)S media_list() ( return list; ) MediaBrldgeDesc" LastMβdiaO ( return last αedia; ) private : MediaBrldgeDesc* node_present (MediaBrldgeDesc "node) ; void assign or_eop (const MediaBridgeDescLists rhs) ; I_ist_of_p(MediaBridgeDe8C) list; MediaBrldgeDesc "last aedia; // aedia specified in the last MR_ADD_SERVER msg int yet to service; } ; " class PartMβdiaBridgeDeacList ( public: PartMβdiaBridgβDββeI_iat(int p, MediaBridgeDescLists { participant • p; med - peed; ) int Participant() { return participant; ) MediaBridgeDescLists MediaList ( return and; ) private : int participant; MediaBridgeDescList med; } ; List_of iβclarβ (PartMediaBridgβDβscList) struct IntβrObjβctBuffβr { CARDS asg_typβ; CARDS asg code; struct si ( CARD32 pseudo id; CARD32 participant; String ' room na__α; CARD32 attrib; MediaBridgeDescList aad; ) βve_crβatβ_aeβting; struct s2 { CARD32 rooa_id; MediaBridgeDescList aad; . eve_accβpt_invitation; struct s3 { CΛRD32 pseudo id; CARD32 real_id; CARD32 participant ; ) β v β _cr β at β _aβeting_in_βrooa; struct s4 { CARD32 rooa_id; } Rep_ar_ereate_rooa; struct sS { CΛRD32 meetingjld; } Rβpjnr_create_meeting; ~ struct s6 ( String machine; int port; ) Rβp nr_add_aβrvβr; struct s7 { String machine; int port; ) Rβp_rβg_gβt_pβrson_info; struct sS ( CARD32 pseudo_id; ) eterl; struct s9 { CARD32 errjsode; ) err; struct sll ( CARD32 participant; String part_namβ; CARD32 rooa_id; CARD32 meβting_id; MediaBridgeDescList med; List_of_p(PartMβdiaBridgeDescList) partjnβd; } βvβ_mββting_invitβ; struct s12 { CARD32 vi_room_id; MediaBridgeDescList med; } Rep vi meeting invitation; // Note that right now the VT send the reject also as a REP instead // of an ERR - change VI struct sl3 { CARD32 room_id; CΛRD32 meeting_id; CARD32 participant ; MediaBridgeDescI-lat aed; ) βvβ_addβd_oβrticiρant; street βl4 { CABD32 vi_roon_id; CAJB32 participant; MediaBridgeDescList aed; ) βvβ_vi_add_participant; struct slS ( CARD32 vi_room_id; CARD32 participant; ) βve_vi_drop_participant; struct slβ { } Rep_drop_partieipant struct slS ( ) ι_ roppe _part c pant; st ) struct s22 ( CΛRD32 vi_rooa_id; ) eve_vi_suspend_a ■ting; struct s23 ( CARD32 rooa_id; CARD32 aeet ng_id; CARD32 participant; ) teaplatel; struct s25 { CΛRD32 room id; ) templates; struct s26 ( CARD32 room_id; CARD32 meet ng_id; CARD32 participant; MadiaBridgeDescList aed; ) tβ-uplateβ; struct sl9 ( CARD32 roomjd; MediaBrldgeDesc med; //List(int) part_list; } template?; struct s27 { CARD32 vi_room_id; CARD32 participant; ) evβ_vi_tβ---platβ2 ; struct s28 { MediaBridgeDescList med; } Rep_list_servβrs; struct β29 { CARD32 real room id; CARD32 aeet ' id; ~ CARD32 owner; ) β ve_vi_join_aββting; street s30 { CAHD32 vi rooa id; MediaBridge eae "" aed; //Lis (int) part list; } βvβ_vi_aoB_ββrver; "" struct s31 ( CARD32 vi rooa_id; MediaBridgebesc med; } ev β _vi_droρ_sβrvβr; ); ♦endif ♦ifndef MSG H ♦de ine MSG_H 1 ♦include <eomnon.h> ♦include <systea_proto.h> ♦include <List.h> ♦include <ioc.h> ♦define ΣNΣT_MλX_REFLTSΣZE 4096 enum msg_obj_statβs { β_MSG_ΣN_SERVΣCE, β_MSG_READr, " ~ "" "" ~ β_MSG_PENDXNG, β_MSG_SERVTCED ); class Message { public: Message(CARD8 msgjtyp, CARD8 msg_eode, int msg_seq_.no, int asg_len, char *msg_d ta. Connection "invoker); CARDS msg_type() ( return type; } CARD8 msg_code() { return opcode; } int msg_seq_no() { return seqjno; ) int msg_len() { return len; } char "msgjdata() { return data; ) char •msg_header() { return header; } int msg_header_len() ( return MSG_HEADER_LEN; } void set_msg_type(CARD8 typ) type - typ; header[MSG_HOFFSET_TYPE] - type; } void set msg eode(CARDS cod) "" "" - eod; header[MSG_HOETSET_CODE] - opcode; ) void 3βt_mβg_seq_no(int seq) seqjio - seq; Conv->lntToBuf (seqjio, headβr+MSG_HO-_TSET_SEQ) ; void sβt_msg_lβn(int 1) // 1 should be a multiple of 4 len - 1; Conv->ΣntToBuf( (len»2) , hβadβr+MSG_HOFFSET_LEN) ; void set msgjieader(CARD8 typ, CARD8 cod, int seq, int 1 ) ~ 11 1 should be a multiple of 4 type - typ; opeode - cod; seq j no - seq; len - 1; header(MSG BOITSET TTPE] - type; header ( MSG_HOI SBT_CODB] - opcode; Conv->ΣntToBuf ( seqjno, header+MSG HOITSST_SXQ) ; Conv->ΣntToBuf (( len»2), hβadβr4*ββ_B0ITSET_I_BN) ; void sβt_aag_data(ehar *dat) { data - dat; ) Connection "MsgSourcβO { return Invoker; ) void sendO; protected: int lβn_in_CARD32(int lβn_in_bytβs); CARD8 type; // aassage type (the class of aβaβage) CARD8 opcode; // aassage code (the particular message in the class) int seq_.no; // sequence nuaber (for hand!ing asynchronou 'int len; // length in bytes char header[MSG_HEADER LEN]; // aassage header (contains the abov // 4 char "data; // the aassage data Connection "Invoker; // the communication object associated with Convert *Conv; RoomFsaMgr "RMgr; // teap vars int err, nbytes; int pos; // position in data to start processing }; List_of_pdβelare(Message) /////////////////////////////////////////////////////////////////////// // Classes of Message: Incoming s Outgoing /////////////////////////////////////////////////////////////////////// class OutgoingMessage : public Message { public: OutgoingMessage(CARDS asg_typ, CARD8 msg_code, int msg_seq_no, int msg len, char "msgjiata. Connection "invoker) : Message(msgjtyp, msg_codβ,msg_sβq_no, msg_len, " ~ msg_data, invoker) { rβp_lβn - 0; ) protected: void coaα tβeplatβl(int vi_room_id, int participant, ~ MediaBridgeDescLists med) ; // Later make it dynaaie char rep_buft∑NΣT_MAX_REPLYSΣZE]; // buffer for constructing the data part // of an outgoing message int rep_len; // length (in bytes) of the data part of an outgoing msg ); class OutgoingRequest : public OutgoingMessage { public: OutgoingRequest(CARD8 asg_typ, CARDS msg_eode, int msg_seq_no, int msg_len, char "msgjiata. Connection "invoker ) OutgoingMessage(msgjtyp, msg_code,msg_seqjιo, msg_len, msgjiata, invoker) {} protected: void teaplatel(int id) ; void tee late2(int id, int part); void t β αplat β 3 ( int id. Media a. Strings udesc); void t β e_plat β 4 ( int id, MediaBridgeDescLists aed); void tβeplatβS() ; ); class OutgoingRβply : public OutgoingMessage { public: OutgoingR β ply ( CARDS asgjtyp, CARD8 asg_code, int aβg_seq_no, int a β g_l β n, char *aag_data, " connection "invoker) : OutgoingMessage(aag_typ, asg_eode,asg_aeq_no, asg_len, asg_data, invoker) () ); class OutgoingBvent : public OutgoingMessage { public: OutgoingBvent(CARD8 asg_typ, CARD8 asg_code, int mβg_seq_no, int msg_len, ehar "msg_data, " connection "invoker) : OutgoingMessage(asg_typ, asg_code,asgjseq j no, asg~len, msgjdata, in oker) {} protected: void teaplatel(int rooa_id, int aeeting_id, int participant) ; void teaplate2(int rooa~id, int aaeting~id) ; void teaplate3(ehar status, int vi_rooa_id) ; void tenplate (ehar status, int vi_room~id, int participant); void tβaplatβS(int rooα_id) ; ~ ~ void teaplateβ(int rooβTid, int aeeting_id, int participant, ~ MediaBridgeDescLists aed); void template (int rooα_id. Strings machine, int port) ; void teaplateβ(ehar "packet, int len) ; void tβaplatβS(int rooa_id, MediaBridgeDescs aed); void teaplatelO(ehar status, int vi_rooa_id, MediaBridgeDescs aed); ); class OutgoingBrror : public OutgoingMessage { public: OutgoingBrror(Connection "invoker) : OutgoingMessage(0, 0, 0, 0, NULL, invoker) {} void connection(Connection "invoker) { Invoker - invoker; . void e action(CARD32 err type, CARD32 msg_eode, ~ "" CARD32 seq j no, CARD32 err_code) ; void success_rβturn(CARD32 err_typβ, CARD32 msg_codβ, CARD32 seqjno) ; >' class IncomingMessage : public Message { public: IncomingMβasage(CARDS msg_typ, CARD8 msg_code, int msg_3eq_.no, int msg_lβn, char "msgj ta, Connection "invoker ) Message(asg_typ, asg_codβ, asg_sβq_no, asg_len, ~ "" asg_data, invoker) { res_len ■ len; iob7asg_typβ - msgjtyp; iob.msg_eode - msg_eodβ; } virtual void action() - 0; protected: void eomaon_actionl() ; InterObjeetBuffer iob; int re β _l β n ; // residue length of data (for processing an incoming mag ) ); class XnceαingReqeeat : public IncomingMessage { public: IncomingRequest ( CARDS a β g_typ, CARD8 asgjsodβ, int asg sβq_no, int asg_l β n, char •aβg ta, Connection "invoker) : IncoaingM β ssage<asg_typ, asg_eodβ, asg_seq αo, asg len, asg_data, invoker) ~ error - new OutgoingBrror(invoker); » -IncomingRequest() { delete error; ) OutgoingBrror *βrror_obj() ( return error; ) virtual void action(7 • 0; protected: . OutgoingBrror "error; // Error object or sending error replies .; class IncomingEvent : public IncomingMessage ( public: IncomingEvent(CARDS msg_typ, CARD8 msg_codβ, int msg_seq_no, int msg_len, char "msg_data. Connection "invoker) : IncomingMessage(msgjtyp, msg_code, asg~seq j .no, msg_len, asg_data, invoker) { } -IncomingEvent() { } virtual void action() - 0; void vi_tβaplatβl() ; // add_part void vi_tea_plate2() ; // leave, reenter void teaplatel(); void tβa_platβ2(); void tβaplate50; void teaplateβ(); void template?() ; .; lass IncomingReply: public IncomingMessage { .ublic: IncomingReply(CARD8 msg_typ, CARDS msg_code, int msg_seq_no, int msg_len, char "msgjiata. Connection "invoker) : IncomingMessage(s_sg_typ, asgjsodβ, msg_sβq_no, msg_len, msg_data, invoker) { ) -IncomingReply() { } virtual void action(); protected: ); class IncoaingError: public Incoα-ingMessage { public: IncoaingError(CARD8 asg typ, CARD8 msg_codβ, int msg_s β q_no, " int msg_len, char "msgjiata. Connection "invoker ) : IncomingMessage(msg_typ, msg_code, msg_sβq_no, msg_len, msg_data, invoker) ( } -Incos ngBrrorO { ) void action() ; ); typedef Message * MessagePtr; ypedef Xne β αinςMessage • ΣneeαingMesaagePtr; ♦endif ♦Ifndef __OBJ MAX B ♦de ine _ OBJ~MAM~H 1 ♦include <coαaon.h> ♦include controller.h> ♦include <conn.h> ♦include <ioc.h> List_of_pdeclare(LocalMedia) /••••*• This is an abstract base elaas for communication o b ject managers, A communication object manager provides methods to manage a se t of Connection objects. ••*••*/ class CoaαObjMgr { public : Co-BβObjMgr (Controller "Ctrl) ( Ctrl - Ctrl; ) -CoaαObjMgrO ( } virtual void process (MsConnβction pconn) - 0; int IsAlivβ O ( return (is_alive) ; ) protected: Controller "Ctrl; int is_alive; int next id; >; class LocalMediaManager : public CoaaObjMgr { public: LocalMediaManager(Controller "Ctrl) : CommObjMgr(Ctrl) { is alive - 1; } -LocalMediaManager() ; ~ void process(MmConnection pconn) ; void ConnectToBridge(int room_id. Media m, Strings udesc, ~ Strings machine, int port) ; void DisconneetFroaBridge(int roomjid. Media m. Strings udesc, Strings machine, int port) ; ;rivate: void garfoage_colleet() ; LocalMedia* ?ind_matching_I_M(Media m, Strings udesc); List of_j3(LocalMedia) cliβnt_list; 1; class Visual∑nterfacaMmiger : public ConmObjMgr { public: VisualΣnterfaeβManager (Controller "Ctrl) : ComnObjMgr(Ctrl) { is__alivβ - 1; ) -VisuallntβrfaceManagerO ; void process(MmConnection pconn); void Meetinglnvite(int seq j io, int room_id, int meβting_id, int participant, MediaBridgeDescLists aad, List_of_p(PartMβdiaBridgβDescList)S partjned. Strings part_namβ) ; void JoinMββting<int vi_rooa_id, int participant); void AddβdParticipant(char status, int real_rooa_id, int rβal_meeting_id, int vi_room_id, int participant, MediaBridgeDescLists med) ; void DroppedPartleipant(char status, int vi_rooa_i d , int participant); void Mee ingDestroyed(ehar statua, int vi_rooα_i d ); void Meetlngfluaponded(char statua, int vi room i d ); void MeβtingResuas (char statua, int vi roαα id); void MeetingLeft(char atatus, int vi room id7 ._. M . _______________ _, . __ * *• Participant, MediaBridgeDescLists a void MeatingReβntered(char status, int vi_rooa_id, . __. . . __. . ** ■ - P*~ticipant, MediaBridgeDescLists m void ListRooαβ(ehar "packet, int pkt len); void LiitMeetings(char *packβt, int pkt_lβn); void Shoi-Mee ingStatna(ehar "packet, int pkt len); void ShowMaetRooaStatus(ehar "packet, int pkt len); void ServerAddad(ehar statua, int vi_rooa_id,~ MediaBridgeDescs aed); void ServerDropped(ehar status, int vi_rooα_id, MediaBridgeDescs aed); private: void garbage_eolleet(); Visuallnterfaee "client; }; class MRServerManager : public ConinObjMgr { public: MRServerManager(Controller "Ctrl, String machine, int port); -MRServerManager(); void process(MsConnection pconn) ; MnConneetion connO; void CreateRoom(int seqjno, int attrib. Strings rooa naae); void ListRooaβ(int seqjio); void ListMeetings(int seqjno); void ShowMeetingStatus(int seq.no, int mβeting_id); void ShowMeetRooaStatns(int seq_no, int meetingjld); void CreatβMββting(int seq_no, int room_id); ~ void DestroyMeeting(int seq_no, int meetingjld); void SuspendMeeting(int seqjno, int meeting_id); void ResuaβMβeting(int seqjio, int meetingjld); void DestroyRoom(int seqjno, int rooa_id) ; void AddServer(int seq_no, int rooa_id. Media a. Strings udesc); void DropServer(int seqjno, int rooa_id. Media m. Strings udesc); void ListServersdnt seq_no, int room_id) ; void GetPersonΣnfo(int seq_no, int part_id); void AddParticipant(int seqjno, int mββting_id, int part_id) ; void DropParticipant(int sβq_no, int mβeting_id, int part_id); void LeaveMeeting(int seq_no, int meeting_id, MediaBridgeDescLists med) ; void RβentβrMββting(int seq_no, int aeeting_id, MediaBridgeDescLists.med) ; private: MRServer *_nr_ser-er; ); class E vβntNotifiβrManager : public ConinObjMgr ( public: Event N otifiβr M anagβr(Controller "Ctrl, String machine, int port ) ; -EventNotifiβrManagβrO; void process(M__Conneetion pconn); MnConneetion connO; void M ββtinglnvitβ(int room_id, int mee ing_id, Me d iaBridgeDescLists med. List(int)s plist, List_of_p(Part M ediaBridgβDβscList)s pmed ) ; vo A d JoiaN β etingdnt rooa_id, int aβeting_id. List(lot)β plist); void JoinN β etiagRejecteddat rooa_id. List(int)s plist); void AdάedParticipaat(int rooβ_id, int aeeting id, int participant, __, ___ Λ M M β diaBridg β DβaeLiats aed, Liat(int)s plist); void DroppedPartieipant(int rooα_id, int aser Iι___ ι1_ int participant, Liat(int)S plist); void MeetingL β ft ( int rooα_id, int aeeting_id, int participant, M β diaBridgaDβacLiatS aed. List(int)S plist) ; void Meeting—>ntered(int rooa_id, int westing id, int participant, MediaBridgeDescLists aed. List(int)« plist) ; void AcceρtInvitation(int rooa_id, int aaeting_id, MediaBridgeDescLists aad. List(int)s pl void Re ectInvitation(int roβa_id, int aeeting_id. Lis (int)s plist); void MeetingDestroyed(int rooβ_id, int aeeting id. List(int)s plist); void M β etingSuspendeddnt rooa_id, int aeeting~id. List(int)S plist); void MeetingResuaad(int rooα_id, int aeeting id. List(int)s plist); void RooaDestroye tint rooa_id. List(int)S plist); void ServerAddeddnt rooa_id, MediaBridgeDescs aad. List(int)s plist); void ServerDropped(int rooa_id, MediaBridgeDescs aad. Lis (int)S plist); private: void multicast(Lis (int)S plist, OutgoingMessage *asg); void send_start_msg() ; EventNotifier *βvβ_not; ); ♦endif ♦ifndef __OϋTGOING H_ ♦define __OUTGOXNG_]H_ ♦include <msg.h> // OUTGOING REQUESTS from CM to MR class OQ_CreateRooa : public OutgoingRequest ( public: OQ_CreateRooa(int asg_seq_no, int msg_lβn, ~ ehar "msg data, Connection "invoker) : OutgoingRequest(REQUEST_MR_SERVER, MR_CREATE_ROOM, msg_seq_no, msg_len, msg_data, invoker) {} void action(int attrib, Strings roomjiame); ); class OQ_CreateMeeting : public OutgoingRequest { public: OQ_CreateMeeting (int msg_seq_no, int msg_len, " ~ ehar *asg_data, Connection "invoker) : OutgoingRequest(REQUEST_MR_SERVER, MR_CREATE_MEETXNG, asg_seq_no, msg_len, msg j data, invoker) {} void action(int rooa_id); "" 1; class OQ_DestroyRooa : public OutgoingRequest { public: OQ DestroyRoeadnt asg_seq_no, int msg_len, ~ ehar " sg data. Connection "invoker) : OutgoingRequest(REQOEST_MR_SERVER, MR_DESTROT_ROOM, asg_seq_no, msg_len, msg_data, invoker ) {) void action(int rooa_id) ; }; class OQ_DβstroyMββting : public OutgoingRequest { public: OQ_DβstroyMββting(int msg_sβq_no, int msg_len. char "asgjdata. Connection "invoker) • OutgoingReques ( RBαCBST_NR_SXRVBR, l«_DBSTROY_HtBTING, Λ _. __.. .. . asg_ β eq_no, aegjlβn, aβg_data, invoker) {} void action(int aeeting id); ); class OCjListRoooβ : public OutgoingRequeat { public: OQ_ListRooaa<int aeg_seq.no, int asg_lβn, ehar * β sg_data. Connection "invoker) : OutgoingRequest ( RBQOBST_MR_SBRVER, MR LIST ROOMS, ■•g seq io, asg leή, asg dataT invoker) (} void action(); ~ ); class OQ_ListMeetings : public OutgoingRequest ( public: OQ_ListMeetings(int asg_seq_no, int aagjlan, char "asg data. Connection "invoker) : OutgoingRequest(REQOEST_MR_SERVER, MR_LXST_MEETINGS, a β g_3 β q_no, asg_lβn, msg dataT invoker) {} void action(); ~ ); class OQ_ShowMβetingStatua: public OutgoingRequest ( public: ~ " OQ ShowMeetingStatus(int msg_seq_no, int msg_lβn, char *asg_data. Connection "Invoker) : OutgoingRequest(REQUEST_MR_SERVER, MR_SHOWJflEBTH-GJ5TaTDS, asg_sβq_no, msg_len, msg_data7 invoker) {) "" void action(int aeeting id); ~ ~ " ); class OQ_ShowMeatRooaStatue: public OutgoingRequest ( public: 0Q_ShowMeetRoos_Statu3(int msg_seq_no, int msg_len, "" char *msg_data. Connection *invoker) : OutgoingRequest(REQOEST_MR_SERVER, MR_SBOW_MEETROOM_STATUS, asg_seq_no, msg_lβn, msg_data, invoker) (} void action(int meeting_id) ; ~ ~ }; class OQ_AddServer : public OutgoingRequest ( public: 0Q_λddServer (int msg_seqj.no, int asg_len, ~ char *asg_data. Connection "invoker) : OutgoingRequest(REQOEST_MR_SERVER, MR_ADD_SERVER, asg_seq_no, msg_lβn, msg_data, invoker) {) void action(int rooa_id. Media m. Strings udesc); 1; class OQJDropServer : public OutgoingRequest { public: OQ DropServer (int aβg_seq_no, int msg_len, "" ehar "asg data. Connection "invoker) : OutgoingRequest(REQDEST_MR_SERVBR, MR_DROP_SERVER, asg_seq_no, asg_lβn, asgjdata, invoker ) I ) void action(int rooa_id. Media a. Strings udesc); ); class OQ_ListServers : public OutgoingRequest { public: OQ ListSβrvβrs(int msg_sβq_no, int asg_len, "" ehar "msg data. Connection *invoker) : OutgoingRequest(REQUEST_MR_SERVER, MR_LXST_SERVERS, msg_sβq_no, msg_lβn, msg_data, invoker ) { ) void action(int rooa id); ); class OQ_AddPartieipant : public OutgoingRequest { public: " ~ OQ AddParticipant(int asg_βeq_no, int aβg_len, ehar "asgjdata. Connection "invoker) : OutgoingRequest(REQOSST_MR_SERVER, MR_ADD_PARXΣCXPANT, a β g_seq_no, asg_leή, asg dataT invoker) (} void action(int aeeting id, int part id); ~ ); class OQ_DropPartieipant : public OutgoingRequest { public: OQ_DropParticipant(int aag_seq no, int asg_len, * ~ ehar "asgjdata. Connection *" "invoker) : OutgoingRequest ( REO~EST_MR_SERVER, MR_DROP_PARTXCXPANT, asg_seq_no, msg_len, msg_data, invoker) {} void action(int meeting id, int part id); ~ ); class OQ_SuspendMaeting: public OutgoingRequest { public: OQ_SusρendMaeting(int msg_seq_no, int msg_len, ~ char *msg_data. Connection "invoker) : OutgoingRequest(REQUEST_MR_SERVER, MR_SUSPEND_MEETXNG, asg_seq_no, msg_len, msg j data, invoker) ( } void action(int meeting_id); ); class OQ_ResuaeMeeting: public OutgoingRequest ( public: OQJResiimaMssting(int msg_seq_no, int msg_len, char *asg_data. Connection "invoker) : OutgoingRequest(REQOEST_MR_SERVER, MR_RESUME_MEETXNG, asg_seq_no, msg_len, msgjdata, invoker) (1 void action(int meeting_id)7 " ~ ' i :lass OQ_LeaveMeeting : public OutgoingRequest ( public: OQ_LeaveMeeting(int msg_seq_no, int msg_len, ~ char "msg data. Connection "invoker) : OutgoingRequest(REQUEST_MR_SERVER, MR_LEAVE_MEETXNG, msg_3βq_no, msg~len, msgjdata, invoker) {) void action(int aeeting id, MediaBridgβDβseLists "" mβd); ); class OQ_ReenterMaeting : public OutgoingRequest ( public: OQ_RβentβrMββting(int msg_seq_no, int msg_len, " * char *msg " ~data, Connection "invoker) : OutgoingRequest(REQUEST_MR_SERVER, MR_REENTER_MEBTXNG. msg_seq_no, msgjen, msgjdata, invoker ) {} void action(int meeting_id, MediaBridgβDescLists " ~aβd ) ; ); class OQ_GetPersonInfo : public OutgoingRequest { public: OQ SβtPβrsonlnfo (int asg_seq_no, int msg_l β n, *** char "msg data, Connection "invoker ) : OutgoingRequest(REQUEST_REGΣSTRT_SERVER, REG_GET_PERSON_INFO, asg_seq_no, msg_len, msgjdata, invoker ) U void action(int part_id) ; ]; // OUTGOING EVENTS from CM to CM and VI class OEJSveMeetlngDestroyed: public OutgoingBvent < public: ~ OBJEvoHe β tingDeatroyed(int asg_seq_no, ____ - " * *"• ■ «9_1«», ehar "asg data. Connection "invoke OutgoingBvent ( BV1MT_CM, EVE_MEETUG DBSTROWD, msg sβq_no, asg_l β n, aβg_data, invoker)~{) ~ void action ( int rooα id, int aaeting id); ); class OEJSveVXMeetingOestroyed: public OutgoingBvent ( public: OE_EveVXMeetingDestroyed(int asg_seq_no, int a β g_l β n, ehar *aβg_data. Connection "invoke OutgoingBvent ( EVENTjCM, BVB rXJMBKTlllGJDBSTROTED, asg_s β qj_.o, asg_lβn7 sag data, invoker) () void action(ehar status, int vi room id); }; ~ class OE_EveVXJoinMeeting : public OutgoingBvent { public: OE_EveVIJoinMeeting(int msg_sβq_no, int msg_len, ehar *aag data. Connection "invoke OutgoingBvent(EVENT_CM, EVE_VΣ_JOIN_MEETING, π-sg_s β q_no, " asg_l β n7 msgjdata, invoker) {} void action(int vi room id, int participant); ""* ); ~ class OE_EveRoomDestroyed: public OutgoingBvent { public: OEJSveRoomDβstroyed(int msg_seq_no, int msg_len, ehar *asg_data. Connection "invoke OutgoingBvent(EVENT_CM, EVE_ROOMJDBSTROTED, aag_seq_no, asg_len, asg_data, invoker) {} "" void action(int room id); }; class OE_EveJoinMeetingRβjected : public OutgoingBvent . public: OE_EveJoinMββtingRβjected(int msg_seq_no, int msg_len, char *msg_data, Connection "invoke OutgoingBvent(EVENT j CM, EVE_JOTN_MEETΣNG_REJECTED, msg_seq_no, msg_len, msg_data, invoker) (} void action(int rooa_id) ; }; class OE_EveAddedParticipant : public OutgoingBvent { public: OE EvβAddβdParticipant(int asg_seq_no, int asg_len, — char "msg data. Connection "invoker) : OutgoingBvent(EVENT j CM, EVE_ADDED_PARTICIPANT, msg_seq_no, asg_len, msg_data, invoker) {} void action(int room id, int meeting_id, int participant, ~ MediaBridgeDescLists aad) ; 1; class OE_EvβVXAddβdParticipan : public OutgoingBvent 1 public : OE_EvβVTAddβdParticipant (int msg_seq_no, int _nsg_lβn, char "msg data. Connection "invoker) : O u t goingEvβnt (E V E N T j C M , EVE_VΣ_ADDED_PARTICXPANT, asg_sβq_no , msg_len, π_sg_data, invoker ) { } void action (char status, int real_room_id, . _, ■ « ,. „_.--. int real_mβeting_id, int vi_room_id, t parti MediaBridgeDescLists aed) ; class OEJBv β DroppedPartieipant: public OutgoingBvent ( public: OEj β v β DrσppedParticipant(int asg_seq.no, ^ _ -** β »g_len, ehar •asgjdata. Connection * invokβ OutgoingBvent ( EVENT_CM, EVB_DROPPRD_PARTXCXPA«T, . , _, « β g_a*q_no7 aβg_l«, asgjdata, invoker) {) void action ( int rooα_id, int aeeting id, int participant)7 }; * ~ class OE_EveVXDroppedParticipant: public OutgoingBvent { public: OB_Ev β VDroppedParticipant(int asg_seqjαo, int asg_len, ehar "asg data. Connection "invoke OutgoingBvent(EVSOTJCM, EVB_VΣ_PARTΣCXPANT_DROPPED, a β gjseq_no7 aβg_lβn, asg data, invoker) () void action(ehar status, int vi_rooα_id, int participant)7 ); class OE_EveRooaLocked : public OutgoingBvent { public: OEJBveRoomLocked(CARDS msg_typ, CARDS msg_code, int msg_seq_no, int msg_len, ehar *asg_data. Connection "invoke OutgoingBvent( msg_typ, msg_coda,asg_seq_no, asg len, msg data, invoker) (} }; class OE_EveRoomOnloeked: public OutgoingBvent { public: OE_EveRooaαnlocked(CARD8 msg_typ, CARD8 msg_code, int asg_seq_no, int msg_len7 ehar "msgjiata. Connection "invoke OutgoingBvent( msgjtyp, msg_eode,asg_seq_no, asg len, msg data, Invoker) 7) ); class OE_EveLeftMβeting : public OutgoingBvent { public: OE_EvβLβftMβeting(int msg_seq_no, ""* int msg_len, char "msg j data. Connection "invoke OutgoingBvent(EVENTjCM, EVE_LEFT_MEBTXNG, msg_seq_no, msg_len, msg_data, invoker) {} void action(int rooa_id, int meβting_id, int participant, "*" MediaBridgeDescLists med) ; ); class OE_EveServerAddβd: public OutgoingBvent { public: OE_EvβSβrverAdded(int asg_seq_no, int msg_len, char *msg_data. Connection "invoke OutgoingBvent(BVENT_CM, EVE_SERVER_ΛDDEb, msg_sβq_no, asg_len, msg_data, invoker) {> void action(int rooa_id, MediaBridgeDescs med) ; }; class oεjSveServerDropped: public OutgoingBvent ( public: OE EveServerDropped(int ___sg_seq_no, ~ int asg len, char *asg_data. Connection "invoke OutgoingBvent(EVENT_CM, "" EVE_SEKVER_DROPPED, asg_seq_no, asg_len, msg_data, invoker) () void action(int room_id, MediaBridgeDescs med) ; }; class OE EveVIServβrAdded: public OutgoingBvent { -lie: OE_EveVXServerAdded(int asg_seq_no, « . * . _—_ < . ,M .■ ** ■ ! _*9- iβo ' -»«* *a β g_data. Connection "invoker) OutgoingBvent ( EVENTJM, EVB_VX SERVER ADDED, asg sβq_no, asgjl β n, a β g_data, invoker) {7 ~ void action ( ehar status, int vi_rooa_id, MediaBridgeDescs sod ) ; J; class OEJKveVTS β rverDropped: public OutgoingBvent { public: OE_EvβVXS β rvβrDropped(int asg_seq j .no, ___ "* * asg_l βή , ehar *aβg_data. Connection "invoker) OutgoingBvent ( EVENT_CM, BVB_VX SERVER DROPPED, asg sβq_no, asg_len, asgjdata, invoker) (7 void action(ehar statua, int vi_rooa id, MediaBridgeDescs aad); 1; class OEJSvβVΣLβftMeβting : public OutgoingBvent ( public: OE_EvβVILβftMβeting(int a_sg_seq.no, int asg_len, ehar *aβg data. Connection "invoker) OutgoingBvent ( EVENT_CM, EVE_VI ffiBTΣRG_LEFT, asg sβq_no, asg_len, asg_data, invoker) {) "" "" void action(ehar status, int vi_rooa_id, int participant, MediaBridgeDescLists aed); ); class OE_EveReenterMeeting : public OutgoingBvent { sublic: " ~ OE_EvβReβntβrMeβting(int asg_seq_no, int asg_len, char *aβg_data. Connection "invoker) OutgoingBvent(EVENT_CM, EVB_REENTER_M_KTXNG, msg_seo.no, asg_len, asg_data, Invoker)7) ~ void action(int rooα_id, int aeetingjid, int participant, ~ MediaBridgeDescLists aed); ); class OEJBvβVXReenterMeeting : public OutgoingBvent { public: OE_EvβVXRββnterMeeting(int asg_seq_no, int asg_len, ehar *asg_data. Connection "invoker) OutgoingBvent(EVENT j CM,~EVE_VI_MEETING_ " REENTERED, msg_seq_no, msg_len, msg_data, invoker) {) void action(char status, int vi_room_id, int participant, MediaBridgeDescLists mad); lass OEJBveM otingSuspended: public OutgoingBvent { public: OE_EveMeβting*uspended(int asg sβq_no, int asg_len, char *asg_data. Connection "invoker ) OutgoingBvent(EVENT_CM, EVE_MEETΣNG_SUSPEBDED,- asg_seq_no, mag j len, msg_data, Invokβr) "" {} void action(int rocα_id, int mβeting_id); ); class OE_EveVXMeetingSuspended: public OutgoingBvent { public: OE EvβVTMββtingSuspβnded(int msg_sβq_no, — int msg len, char *___sg_data. Connection "invoker ) OutgoingBvent(EVENTjai, EVE_VI_MEETXNG_SUSPENDED, msg_seq_no, msg_len, msg_data, invoker) {} void action(char status, int vi_room_id) ; }; class OE EveVIListRooms: public OutgoingBvent public: OB_BveVXListRooas(ist αsg_seq_no, ^ .. L __. Anfe ■,,β _ lβn ' «= ar *asg_data. Connection "invoker) OutgoingBven ( BV«NT_CM, EVB_VI LXST_ROOMS, asg seq no, ■»g_l β n, asgjdata, invoker) () void action(char •packet, int len); ); class OEJtvoVIShoeMooelngStatue: public OutgoingBvent { public: OE_EveVΣShowMeetingStatus(int aβg_seq_no, ___ at ■«g_len, ehar *asg data. Connection *invokβr> OutgoingBvent(EVBNTjat, BVB_VΣ SBOVJMESTΣNG STATUS, asg seo j .no, asg_lβn, asgjdata, invoker) () ~ ~ void action(char "packet, int len); ); class OE_EveVΣShowMeetRooaStatus: public OutgoingBvent { public: ~~ OE_EveVΣShowMaetRooaStatus(int msg_sβq_no, int msg_lβn, char *asg_data. Connection "invoker) OutgoingBvent(EVBNT_CM, EVE_VT_SHOir_MEETROOM_STATUS, msg sβq_no, msg_lβn, asg_data, Invoker) "" {) " ~ ~ void action(ehar "packet, int len) ; class OE_EvβVΣListMββtings: public OutgoingBvent ( public: ~ 0E_EveVIListMeeting8(int msg_seq.no, int msg_lβn, ehar *asg_data. Connection "invoker) OutgoingBvent(EVENT_CM, " ~EVE_VI_LΣST_MEETINGS, aag_seg_ao, msg_len, asgjdata, invoker) {} ~ void action(ehar "packet, int len) ; ~ .lass OE_E eMeetingResumed: public OutgoingBvent ( public: OE_EveMeetingResumed(int msg_seqjιo, — int msg_len, ehar "msg j data. Connection "invoker) OutgoingBvent(EVENTjCM, EVE_MEETΣNG_RBSUMED, msg_seq_no, msg_len, msg_data, Invoker) {} void action(int rooa_id, int aeeting_id); .; class OE_EveVXMeetingResuaed: public OutgoingBvent ( public: OE_EveVIMeetingResumed(int msg_seq_no, ~~ int msg len, char *msg_data. Connection "invoker ) OutgoingBvent(EVENTjCM, " ~EVE_VΣ_MEETΣNG_RESUMED, msg_seq_no, asg_lβn, asg_data, invoker) {} void action(char statua, int " vi_rooa_id) ; ..lass OEJSveCMStart : public OutgoingBvent { public : OE EvβCMStart (int msg_sβq_no, ~ int msg_lβn, char "msg j data. Connection "invoker j OutgoingBvent (EVENT_CM, EVE_START_C0»-K--NΣCATΣON, msg_seq_no, msg_lβn, msg j data, invoker) ( ) void action () ; } ; class OE_EveMult least : public OutgoingBvent { public: OE EveMulticast(int msg_sβq_no, int msg_len, char "msg data. Connection "invoker ) : invoker) () class OEJSvβMeβtinglnvitβ : public OutgoingBvent { public: "" OE_EveMe β tinglnvitβ(int aβg_seq_no, int asg len, char *aag_data. Connection " "invoker) : OutgoingBvent(EVENTJCM, BVBJflβTXIIG_XNVXTE, asg_seq_no, asg lenT asg data, invoker) (} void action ( int rooa_id, int aeetiag id, _iarHsBr7dqeneBcLlJt-l aed, Liat_of_p ( PartMediaBridgeDeecList>s pαed); ); class OB_EveλcceptInvitation: public OutgoingBvent { public: " ~ OEJEvβAeeβptlnvitation(int asg_sβq_no, int asg_len, char *Bsg_data7 Connection "invoker) : OutgoingBvent(EVENTjCM, EVEJICCJBPTJINVXTATΣON, Bsg_seq_no, asg_len7 asgjdata, invoker) {} void action(int rooa id, int aeeting id, MediaBridgeDescLists sod) ; >; class OE_EveRejectΣnvitation: public OutgoingBvent ( public: ~ " OE_BveRejβctlnvitation(int asg_seq_no, int asg_len, ~ char *msg_data7 Connection "invoker) : OutgoingBvent(EVENTjCM, EVE_REJECT_ΣNVXTATΣON, asg_seq_.no, asg_len7 msg j data, invoker) {} void action(int rooα id, int aaeting id) ; ~ ); class OE_BveJoinMeeting: public OutgoingBvent ( public: " ~ OE_EveJoinMeeting(int msg_seq_no, " ~ int msg_len, ehar *msg_data. Connection "invoke OutgoingBvent(EVENT j CM, EVE_JOΣN_MEETΣNG, msg_seq_no, msg_len, msg j data, Invoker) {} void action(int rooa_id, int aeeting_id) ; }; class OQ_VIMββ inglnvite : public OutgoingRequest ( public: OQ VIMββtinglnvite(int asg_sβq_no, int msg_lβn, ~ char •asg j ata. Connection "invoker) : OutgoingRequest(REQUEST_VΣ, VX_MEETING_ΣNVITATION, asg_seq_no, asg_lβn, asgjdata, invoker) ( } void action(int rooα_id, int mβeting_id7 int participant, Strings partj i ame, "" MediaBridgeDescLists aed, List_of_p(PartMβdiaBridgβDβscList)S pmed) ; ); // OUTGOING EVENTS TO Local Media Managers class θE_BvβConnβctToBridgβ : public OutgoingBvent I public: OE EveConnβetToBridgβ(int msg_sβq_no, int msg_l β n, ~ * ehar *msg data. Connection "invoker ) : OutgoingBvent(EVENTjCM, MAN_CONNECT_TO_BR_πxa, asg_seq_no, " ~msg_len, msgjdata, invoker ) I ) void action(int room_id, Strings machine, int port ) ; }; class 0E_EveDisconnβctFromBridgβ : public OutgoingBvent . public: OEJEveOisconaectrroaBridgadnt aβg βeqjno, int asg len, char "asgjdata. Connection "invoker) : OutgoingBvent ( EVENTJCM, MAHJDΣSCOHNBCTjrRαM BRIDGE, asg_seq.no, asg len7 asg data,-invoker) {) void action ( int rooa_id. Strings machine, int port); ); " ~ ♦endif ♦ifndef MR PROTO B ♦define MR~PROTO "" B 1 ♦include <coaaon.h> ♦include <s_sg.h> ♦include <generator.h> This class provides sαthods for interpreting aassage headers, constructing ; appropriate aassage objects based on the type/opcode. If new messages are added or existing aaaaages are changed, then the new message handling procedure has to be registered with this class (as this class is used for the construction of any sαssage object) . There should be only one instance of this class. *•••••••*•/ IncomingMessage *default_generator( CARDS, CARD8, CARD32, CARD32, char *, Connection class Protocol { public: Protocol(Controller "Ctrl) ; -Protocol{) {); // registers a new message handler (action() routine) for the message // specified by type/opcode. int register msg proe(CARD8 type, CARD8 opeode, "" IncomingMessagβPtr (*βeg_proe) (CARDS type, CA CARD32 seq, CARD32 len, char "data, C // interprets the 'header' of the aassage: type, opeode, seq and len // paraaeters will contain the typ, opeode, sequence number and the // length (in bytes) of the message, void interpret header(ehar "header, CARDSS type, CARDSS opeode, ~ CΛRD32S seq, CARD32S len) ; // returns the appropriate message object after constructing it. the // object is allocated in the heap. IncomingMeeβage "construct asg(CARDS type, CARD8 opcode, CARD32 seq, CARD32~len, ehar "data. Connection "conn ) ; private: // a table to maintain the message creation procs // for all the messages in the system. IneoaingMβssagβPtr <*Gβn_func_tab{MAX_MSG_TΪPES] [MAX_MSGS] ) ( CARD8, CARD8, CARD32, CARD32, char *, Connection * ) ; Controller "Ctrl; Convert *Conv; }; ♦endif ♦ifndef STATE_H_ ♦define STATE_H_ ♦define XMVZTS_TXMEOUT (60) .'include <List .h> ♦include <ioβtreea.h> ♦include <systea_proto __h> ♦include <FB_typeβ .b> ♦include <eoϋαon.h> ♦include <ioc.h> ♦include <sysβnt .h> ♦define MAX NUM FSM_STATES 200 ♦define MAX~"NUM~FSM TRANSITIONS 300 /• TRIGGERS ♦define TO 0 ♦define TI 1 /* EVEHT_VI tt EVE CREATE MEETING ♦define T2 2 /* EVEHT n tt EVE_VI_CREATE_MEET_ΣN_EROOM ♦define T3 3 /• BVENT_VΣ SS EVE_VX_JOIN_MEBTIlKS ~ ♦define T4 4 /* EVENT " ~CM tt accepted EVEJfEETXNG INVITE ♦define T5 5 /* REPLY " ~MR SERVER tt MR CREATE ROOM tt NS>0 */ ♦define T6 6 /• ERROR~MR~SERVER ti MR. "" CREATBJROOM ♦define T7 7 /* REPLY OTSERVER SS MR_ADD_SERVER tt NS>0 ♦define T8 8 /* REPLY MR~SERVER tt MR~ADD_SERVER ti NS-0 ♦define T9 9 /* REPLY~MR~SERVER it MR~CREATE_MBETXNG ♦define T10 10 /* REPLYJOTSERVER tt MR "" ADD_PARTICΣPANT ♦define Til 11 /• EVENT CM~SS EVE_DROPPED PARTICIPANT SS SELF */ ♦define T12 12 /* EVENT_vT it EVE_VΣ ADDJPARTΣCXPΛNT ♦define T13 13 /* EVENTjCM tt EVE_ACCEPT_ΣNVITATXOIt ♦define T14 14 /* EVEHT_VΣ SS EVE_VI_STJSPEIO_MEETXMG ♦define T15 15 /• ERRORJMR SERVER SS MR_SUSPEND_MEETXNG ♦define T16 16 /* REPLY MRTSERVER ti MR~SUSPEND~MEETI-SG ♦define T17 17 /* EVENT~CM~SS EVE_MEETl5G_SaSPraDED ♦define T18 18 / * EVENT j CM SS EVE " MEETING~RESaMED ♦define T19 19 /* REPLYJTI SS VT MEETING_INVTTATΣON ♦define T20 20 /* EVENT_CK SS EVE ADDED_PARTICΣPANT ti SELF */ ♦define T21 21 /* ERROR_VΣ SS VT_MEETΣNG_ΣNVTTATΣON ♦define T22 22 /* EVENT_CM SS EVE_JOIN_MEETING_REJECTED ♦define T23 23 RBPLY_MR_SBRVBR tt MR CREATE ROOM it NS-0 ♦define T24 24 */ ERBOR_MR_SERVER tt MR_ " CRSA3S_MEETXHG ♦define T25 25 BRROR_MR_SERVER tt MR * ~ADD PARTICIPANT ♦define T26 26 EVERT CK ii EVBJOJBCT INVITATION ♦define T27 27 BVBIRJVT tt EVE VT~LEAVB MEETING ♦define T28 28 EVBNT_VT tt EVB_VZ_R_EB-RRR WETXMO ♦define T29 29 REPLYJΛ SERVER. ' sS MR REENTER MEETING ♦define T30 30 ERRCR α_SSRYRR tt MR~ " RBBNTBR~MBBTΣNG ♦define T31 31 BVENT~VT~SS EVE VI RESUME MEETIMU ♦define T32 32 REPLY_MR_SBRVER~SS~MR RBSUMBJMEETXNG ♦define T33 33 ERROR_MR_SERVER tt MR RESUME MEETΣNG ♦define T34 34 EVEHT_VT~SS EVE VT_ADD_SERVER ♦define T35 35 RBPLY_MR_. SERVBR.~SS MR ADD SERVER ♦define T36 36 ERROR~~MR~SERVER it MR~A1»~SERVBR ♦define T37 37 BVENT~VT~SS EVE VI DROP SERVER ♦define T38 38 REPLY_MR_SBRVER~ * SS "" MR DROP SERVER ♦define T39 39 ERROR~MR_SERVER tt MR~ ROP~SERVER ♦define T40 40 REFLY~MR~SERVER SS MR * ~GET PERSON INFO ♦define T41 41 ERRORJOTSERVER SS MR~GET~PBRSOM~ΣNFO ♦define T42 42 EVENT~CM~SS EVE ΛDDED~PARTTCIPΛltT tt NOT SELF */ ♦de ine T43 43 EVENTjCM tt EVE~DR0PPΪD_PARTΣCIPAMT tt NOT SELF •/ ♦define T44 44 EVENT_CM tt EVE_LEFT_MEETXNG ♦define T45 45 EVENTJCM it EVE REENTER MEETING ♦define T46 46 EVENT CM ti EVE~SERVER ADDED ♦define T47 47 EVENT CM SS EVE~SER.VER~DRO?PED ♦define T48 48 TIMEOUT SS TIMEOUT ♦define T49 49 /* EVENT CM tt EVE MEETING DESTROYED */ ♦define T50 50 /* EVENT CM ti EVE "" ROOM_DESTROYED ♦define T51 SI /* EVENT VI tt EVE~VT DROP PARTICIPANT */ ♦define T52 52 /* REPLY~MR ti MR DROP PARTICIPANT ♦define T53 53 /* ERRORTMR tt MR_DROP~PARTICIPANT ♦define T5555 /• EVE-ttJVX ti EVE VI DESTROY ROOM ♦define T56 56 /• EVENT VI tt EVE~VI""DESTROY_MEETING ♦define T57 57 7* ERROR MR SERVER tt MR ADD SERVER SS NS>0 ♦define T58 58 /• ERROR~MR~ " SERVER tt MR_ADD_SERVER SS NS-0 ♦define T59 59 /* REPLYJMR ti MR DROP_PARTICΣPANT tt part - SELF */ ♦define T60 60 /• REPLY MR tt MR_LIST_SERVERS ♦define T61 61 /• ERRORJ-R tt MR LIST SERVERS ♦define T62 62 /* EVENTJCM SS EVE JOIN MEETING ♦define T63 63 /* EVENT VΣ SS EVB_VΣ_JOΣN_MEETING ♦define T64 64 /* EVENT CM SS EVE~JOINJ_EETING_REJECTED ♦define T65 65 /* EVENT_VX ti EVE_JOIN_MEETING_REJBCTED ♦define T66 66 /* EVENT VI SS EVE_JOIN~MEETING~ACCEPTED ♦define T67 67 7* REPLY MR_SERVER SS t£_CREAXE_MEETING SS " " last_part - SELF List_of_pdeclare(Con eree) class Conferee { public: Conferee(int e_id, MediaBridgeDescLists alist ) i id - c_id; media list - mlist; S tatus - β_PRESENT_IN_MBET; ) -Conferee() ( cout « "\nConferee ■ « id « " deleted" « endl; } int ∑d() { return(id); } ConfereeStatus Status0 ( return status; . void addjnβdia(MediaBridgeDescs med ) ; void dropjBBdia(MediaBridgeDescs aed ) ; void leave() { status - β_ABSENT_IN_MEET; } void rβentβrO ( status •~β_PRESENT_IN_MEET; ) MediaBridgeDescLists MediaListO { return media_list; } private: in; _i; ConfareeStatus status; MediaBridgeDescList aedia list; } : ~ class Meeting ( public: Meeting ( int ae β ting_id, RooaTsa "proom, RocaFsaMqr *pRMβr); -MoetingO; ^ *^ int ∑d() { return(id); ) int nua_eonf β ree β( ) ( return(conf_list.length()) ; ) MeetingStatus get_aββting_statuβ(7 { return statua; ) int adα partieipant ( int participant, MediaBridgaDeacLlst mlist) ; int droρ_partieipant(int participant); void addjaediadnt participant, MediaBridgeDeae aed); void dropjaedia ( int participant, MediaBrldgeDesc aad); void dropjaedia(MediaBrldgeDesc aed) ; int suspendjneetin O; int resuBβ aeetingO ; int lβavβ_ϋ_eβting(int participant); int rβentβr_βeβting(int participant) ; List ( int)s PartListWithoutMeO { return(conf_wo j _α_list) ; } List_of_p(Con eree)S ConfereβList() ( rβturn "" conf list; ) private: void drop_all_partieipants() ; void drop_conf_wojnβ_list(int participant) ; int id; RoomFsm "room; MeetingStatus status; RooaFsaMgr "RMgr; List_of_p(Conferee) conf_list; List7int) conf_wo_aβ_list; int err; — — — ); class RoomFsm ( public: RoomFsm(int p_vi_room_id, int p_real_room_id, IntβrObjectBuffers iob, RoomFsmMgr" mgr); -RoomFsm() ; int viRoo-SΣdO ( return vi_room_id; } int RealRoomΣdO { return real_room_id; } Meeting* MeetO < return aaeting; } int LastSeqNoO { return last_seq; ) int LastPartldO ( return last_part_id; ) unsigned state() { return eurrent_state; ) int fire(IntβrObjectBuffers iob) ; void timβr_tick() ( chβek_updatβ_invite_timβr() ; } private: void 3βt_invitβ_tisαr(int tiaβr_val) 7 invitβ_timβout - timer_val; alarm(1); } void rβsβt_invitβ_tiaβr() t invitβ_tiaβout - -1; } void chβck_updatβ_invite_timβr() ; int fire(unsigned input, IntβrObjectBu ers iob) ; struct Transition ( int (RoomFsm::"action) (InterObjectBuffer&) ; unsigned dest; } transitions(MAX_N0M_FSM_STATES]tMAX_NαM_FSM_TRANSITIONS]; void register transition(unsigned src, unsigned input, ~ unsigned dest, int (RoomFsm::"action) (InterObjectBufferS ) ) transitionsIsrc] [input] .dest - dest; transitions ( src] [input] .action - action; -nt de ault_action ( IntβrOb ectBu fβrβ iob) ( return(0); ) int Bl_aetion(IntβrObjectBuffers iob) int E2_actio β (IntβrO jectBuffers iob) int B3_action(IntβrObjectBuf ers iob) int B4_action(ΣntβrObjectBu fers iob) int B5_action( ntβrObjectBu fers iob) int E6_action(IntβrObjectBuffers iob) int B7_action(IntβrOb ectBuffers iob) int B β _action(IntβrObjectBuffers lob) int E9_action(IntβrOb ectBu fers iob); int E10_action(IntβrObjectBuf ers iob); int Ell_aetion(IntβrObjectBu βrs iob) { return(0); } int E12_action(InterObjectBuffβrs iob); int E13~action(IntβrObjectBuffβrs iob); int E14~action(IntβrObjectBuf erS iob); int E15_ac ion(IntβrObjectBuffβrs iob); int E16_action(InterOb ectBu βrs iob); int E17_action(IntβrObjectBuf ers iob); int E18_action(IntβrObjectBuf βrs iob) { return(0); ) int E19_action(InterOb ectBuf ers iob) int E20_action(IntβrOb ectBuf ers iob) { return(0) int E21~ac ion(IntβrObjectBuf erS iob) ( return(0) int E22_action(IntβrObjectBufferS iob) ( return(0) int E23~action(IntβrObjectBufferS iob) { return(0) int E24_action(IntβrObjectBufferS iob) { return(0) int E25~action(IntβrObjectBuffβrs iob); int E26~ac ion(IntβrObjectBuffβrs iob), int E27_action(IntβrObjectBuffβrs iob) int E28~action(IntβrObjectBufferS iob) i return(0); } int E29 " action(IntβrObjectBufferS iob) int E30_action(IntβrObjectBufferS iob) I return(0); ) int E3l~action(ΣntβrObjectBufferS iob); int E32_aetion(ΣntβrObjectBu ers iob); int E33_action(ΣntβrObjectBuffβr iob); int E34_action(InterObjectBuffers iob) ; int E35~action(IntβrObjβetBufferS iob) ( return(0); int E36_aetion(IntβrObjectBu f -zt iob) ( return(0) ; int E37~action(IntβrObjectBuf βrs iob); int E38_action(IntβrObjectBufferS iob) ; int E39_action(InterObjectBufferS iob) ; int E40~action(InterObjectBufferS iob); int E41_action(IntβrObjectBuf erS iob); int E42_action(InterObjectBufferS iob) ; int E43_action(IntβrObjectBufferS iob); int E44 " action(InterObjectBufferS iob); int E45_aetion(InterO jectBu ers iob); int E46_action(IntβrObjectBufferS iob) ; int E47 " action(InterObjectBufferS iob); int B4enaction(InterObjectBufferS iob); int E49~action(IntβrObjectBuffβrs iob); int E50 _ction(ΣntβrObjectBufferS iob); int E51~action(IntβrObjectBufferS iob) ; int ES2_action(InterObjectBuffers iob) ; int E53 _.ction(InterObjectBufferS iob); int E54_action(IntβrObjectBuffβrs iob) { return(0); } int E55~action(InterObjectBufferS iob) ( return(0); } int E56~action(IntβrObjectBuffβrs iob) ; int E57~action(IntβrObjectBuffers iob) ; int E58_action(IntβrObjectBufferS iob) ; int E59~action(ΣnterObjectBu fers iob) ; int E60~action<IntβrObjectBufferS iob) ; int B61_ac lon(InterO jeetBuf mxt iob) int E62_actlon(XntexθbjeetBuffers iob) int B63_*ction(IntβrObjectBuffβrs iob) int B64_actlon(InterObjectBuf ers iob) int E65_action(InterObjectBu fβrs iob) int B66_action(IntβrObjectBu fβrs iob) int E67_aetiαa(InterO jeetBuffers iob) ( return (0) ; } int B6 β _action(IntβrObjectBuffβrs iob) int E69_actioβ(IntβrObjectBuffβrs iob) int E70_action(IntβrObjectBuffβrs iob) int E71_action(IntβrObjectBuffers iob) ( return(0); } int E72_aetion(InterObjectBuffβrs iob) ( return(0); } int E73_aetlon(IntβrObjectBuffers iob) ( return(0); ) int E74_action(InterObjeetBuffers iob) ( return(0); } int B75_aetion(IntβrObjeetBuf xt iob) int B76_aetioa(InterO eetBuf ers iob) int E77_action(IntβrObjeetBuf ers iob) int E78_action(IntβrObjectBu fβrs iob) int E79_aetion(IntβrObjeetBuffers iob) int E80_aetion(IntβrObjectBuf βrs iob) int E8Inaction(IntβrObjectBufferS iob) int E82 _etion(InterObjectBuffβrs iob) int E83~action(IntβrObjectBu fβrs iob) int E84_aetion(IntβrObjeetBuffβrβ iob) int E85~aetion(InterObjeetBuffers iob) ( return(0); } int E86_action(IntβrObjeetBuff a∑t lob) ; int E87_aetion(IntβrObjeetBuffers iob); int E88_aetion(IntβrObjeetBuff -nzi iob); int E90_action(IntβrObjectBuf βrs iob); int E91_aetion(IntβrObjectBufferS iob); int terainate_action(InterObjectBufferS iob) ; void nextjasgprepare(); int invitβ_tiaβout; unsigned eurrent_state; MediaBridgeDescList reqjnβdia; MediaBridgeDescList full_mβdia; MediaBridgeDescList acceptedjnβdia; MediaBridgeDescList leavejnedia; MediaBrldgeDesc lastjeed; int scenario; int last seq; // seq j no of the last message sent by this fsm int last j ρart_id // id of the last person called ); Mst j jf j pdeclarβ(RooaFsa) .lass RooaFssMgr { -ublic: RooaFssMgr(Controller "Ctrl, int self ) . sβlf_id - self; global_3βq_no - O.¬ Ctrl-- Ctrl; } -RooaFssMgr() {} void alarm handler(); Controller* Control0 { return Ctrl; } int Myself () < return aelf_id; ) int NextSeqNo O ( return gϊobal_seq_no-M-; } // later find a waay to reuse seqnos int CroataBswrSM tint vi_rooa_id, int actual_rooa_id, ~ " ~ "* InterOb jectBuf fβrβ iob) int firβ_VX(int vi_rooa_id, IntβrOb jectBuf ferS iob) ; int fire (int actuaϊ_rooa_id, IntβrOb jectBu ferS iob) ; int fire_using_seqno (int~sβq_no, IntβrObjectBuffβrS iob) ; int GetRooaInfo_VΣ (int vi_rooa_id) { return (SUCCESS) ; ) int GetRooaXnfo dnt aetuaT_rooa_id) ( return (SUCCESS) ; } private: void garbagβ eollect(RooaFsa *r) ; void garbage " collect() ; List_of_p(RooaFsa) rooa_list; int global seq_.no; }; ♦endif Heading: cmjnsg.h Date: Tue Jan 26 18:03:54 EST 1993 Job-Id: z-581 Printer: Iwt2 ♦define PBRXDGS "Phone" ♦de ine ORXDGB "X" ♦define VBRIDGB "Video" ♦include <ea_asg.h> ♦include <conn.h> ♦include <atate.h> void IncoaingError: : act ion () ( ( void ) Conv->BufToCARD32 (data+pos, ras_len, nbytes, iob. err. err code) ; pos +• nbytes; ~ RMgr->f ir β _using_seqno (asg_sβq_no ( ) , iob) ; void IncomingMessage : : coaa_on aetionl O ( String ( void) Conv->BufToCARD32(data+pos, res_len, nbytes, iob.eve create aeeting.pseudo id); pos +- nbytes; ~ ~ ( void ) Conv->BufToCΛRD32(data+pos, rβs_lβn, nbytes, iob.eve create aeeting.participant); pos -H» nbytes; ~ ~ (void) Conv->BufToCΛRD32(data+pos, rβs_lβn, nbytes, iob.βvβ_creatβ_aββting.attrib); pos +• nbytes; "" ~ (void) Conv->BufToString(data+pos, res_len, nbytes, iob.eve_ereatejBβeting.rooa_naae); pos +«■ nbytes; " ~ " " " " int list len - 0; Media m;~ String udesc; (void) Conv->BufToCARD32(data+pos, res_len, nbytes, list_len); pos +- nbytes; "" "" ♦ifdef DEBUG eout « "Received IE_CreatβMββt: Part: " « iob.evβ_crβatβ_mββting.participant « " Attrib: " « iob.eve createjnββting.attrib « " Listlβn: " « list_len «endl; #βndif ~ for (int i - 0; i < list_lβn; i++) ( m - (Media) data[pos++]; (void) Conv->BufToString(data+pos, res_len, nbytes, udesc); pos +• nbytes; ♦ifdef DEBUG cout « "Requested aed: " « (int)a « " Udesc: " « udesc « endl; ♦endif iob.eve_ereate_aeeting.aed.add(s_, udesc); ) RMgr- CreateNβwFSM(iob.eve_ereateji-eeting.pseudo_id, ROOMJUKλSSΣSIED, iob) ; } void IncomingEvent : : vi_te&-platel ( ) { (void) Conv->Bu ToCARD32(data+pos, res len, nbytes, ~ io b .ev β _vi_add_participan t .vi_room_ιd) ; pos +" nbytes; (void) Conv->Bu ToCARD32(data+pos, res_len, nbytes. « p « os__ . ♦__"_. . ao___y_-c..e_ . s__ . iob. β ve_vi_addjparticip*nt. articipan int list_len - 0; Media a; String udeec; . (void ) Conv->BufToCARD32 (data+pos, res len, nbytes, list len) ; pos + ■ nbytes; "" " " for (int i - 0; i < list_lβn; i++) { a - (Media) dataTpos++]; (void ) Conv->BufToString(data+pos, res_len, nbytes, udesc); pos +■ nbytes; " ~ iob.eve vi_add_partieipant.aed.add(S-, udesc) ; } ♦ifdef DEBUG cout « "vi_teaplatβl: vi_rooa: " « iob.eve_vi_add_participant.vi_rooB_id « " Part: " « iob.eve vi_add_participant.participant « endl; ♦endif ~ RMgr-> irβ VX(iob.βve_vi add_participant.vi rooa id, iob); ) void IncomingEvent::vi_tβmplatβ2() ( (void) Conv->BufToCARD32(data+pos, res_lβn, nbytes, iob.βvβjri_te_aplatβ2.vi_room_id) ; pos +- nbytes; ~ " ~ " ~ ~ iob.βvβ_yi_tβmplatβ2.participant - RMgr->MySβlf(); RMgr->fire VI(iob.eve vi teaplate2.vi rooa_id, iob); ) void IncomingEvent: :teaplatel() ( int sre; (void) Conv->BufToCARD32(data+pos, res_len, nbytes, src) ; pos +- nbytes; (void) Conv->BufToCARD32(data+pos, res_lβn, nbytes, iob.templatel.rooa_id); pos +• nbytes; (void) Conv->BufToCARD32(data+pos, rβs_lβn, nbytes, iob.templatel.mββting_id) ; pos +- nbytes; (void) Conv->BufIoCARD32(data+pos, rβs_lβn, nbytes, iob.teaplatel.participant) ; pos +- nbytes; ♦ifdef DEBUG cout « "IB t^_platel: Rooa: " « iob . tββplatβl . roo β _id « " * " Meet : " « iob. tβn-platβl . meet ing_id « ■ Part: ■ « iob. teπ_platel. participant « endl; ♦endif RMgr->fire(iob.teaplatel.room_id, iob) ; ) void IncomingEvent::teαplate2() ( void) Conv->BufToCARD32(data+pos, res_len, nbytes, iob.template .sre_par ) ; pos +- nbytes; ( void) Conv->BufToCARD32(data+pos, res_len, nbytes, iob.template2.room_id) ; pos +- nbytes; ( void ) Coav->BufToCBRD32(data+pos, res_len, nbytes, iob.teaplate2.aaeting id); poβ +- nbytes; ~ RMgr->fire(iob.tβaplate2. ooa id, iob); ) void IncomingEvent::tee_plateS() { int sre; ( void ) Conv>BufToCΛRD32 (data+pos, res len, nbytes, ere) ; pos +- nbytes; "" ( void ) Conv->BufToCARD32 (data+pos, ros_len, nbytes, iob . tαϋplateS . rooa id) ; pos +- nbytes; " ~ RMgr->fire(iob.tem lates.rooa_id, iob); ) void IncomingEvent::templates() { int src; (void) Conv>BufToCλRD32(data+pos, ros_lβn, nbytes, sre); pos +- nbytes; ~ (void) Conv->BufToCARD32(data+pos, res_lβn, nbytes, iob.template^.room_id); pos +- nbytes; " ~ (void) Conv>BufToCARD32(data+pos, res_lβn, nbytes, iob.tβ-φlate6.aeeting_id) ; pos +■ nbytes; " ~ (void) Conv->BufToCARD32(data+pos, rβs_len, nbytes, iob.tβaplatββ.participant); pos +■ nbytes; String udesc; (void) Conv->BufToCARD32(data+pos, res_len, nbytes, list_lβn) ; pos +■ nbytes; for (int i - 0; i < list_lβn; i++) ( m - (Media) data(pos++]; (void) Conv->BufToString(data+pos, res_len, nbytes, udesc) ; pos +■ nbytes; iob.tβaplatβ6.med.add<m, udesc); ) RMgr->fire(iob.teαplate6.rooa_id, iob) ; } void IncomingEvent::tβmplatβ7() { (void) Conv->BufToCARD32 (data+pos, res_lβn, nbytes, iob.tβmplate7 ,room_id) ; pos +■ nbytes; io b .te__-plate7.med.m - (Media) data [pos++] ; (void) Conv->BufToStrin (data+pos, res_len, nbytes, iob . teaplate7.med . udesc ) ; pos +• nbytes; ( void) Conv->BufToString(data+pos, res_len, nbytes, iob.template7.med.machine) pos +■ nbytes; ( void ) Cenv->B«fToCARD32 (data+poa, res.lβn, nbyt.., pos +- nbytes; -°b-t ββ -plat β 7.med.port ) ; ♦ifdef DEBUG cout « "to___plat.7 : Mach: - « iob.t^iat.7.« . MC hin^< - - ♦endif « iob.teaplate7.aed.port « en l L; /• LATER: int list_lβn - 0; rt ) ; RMgr-> ire(iob.teaplate7.room id, iob); > ///////////// EVENTS FROM VΣ TO CM void lEJSvaVXDown::action() cout « "VI went down. Shutting down..." « endl; CM_3hutdown(); 1 void IE EveCreateMβeting::action() canon action!(); ) void IE BvβCreatePersistentMβeting::action() { cou-_on_aetionl(); 1 void IE_EveVΣCreateMββtInERoom::action() (void) Conv->BufToCARD32(data+pos, res_len, nbytes, iob.βve_create_mβeting_in_erooπ.pseado_i pos +» nbytes; — (void) Conv->BufToCARD32(data+pos, res_lβn, nbytes, ~ iob.βvβ_crβatβ_meβting_in_βroom.real_id) pos +• nbytes; "* (void) Conv->BufToCARD32(data+pos, res_lβn, nbytes, _ iob.βve_creatβ_meeting_in_eroom.partici pos +- nbytes; ~ * RMgr->CreateNe«FSM(iob.eve_create_Bβeting_in_erooa.pseudo_id, "" iob.evβ_creatβ j aeβting_in_erooB.real_id. void ΣEJSvβV JoinMββting::action() { (void) Conv->BufToCλRD32 (data+pos, res_len, nbytes, iob . βve_vi_ joinjnββting . real jroomjd ) ; pos +- nbytes ; (void) Conv->BufToCΛRD32 (data+pos, res_len, nbytes, iob. βvβ_vi_ join j nββting. meet_id ) ; pos +- nbytes; (void) Conv->BufToCARD32 (data+pos, res_len, nbytes, pos +- nbytes ; ; RMgr->CreatoMswrSM (ROOM_UNASSIGHED, iob . eve_vi_join_aeet ing , eal_rooa_ld, iob) ; void IE_EveVIJo1nM— tlngR jected: : action () ( vi tβn_platβ2 () ; ) void IE EveVIΛddPartieipant::action() { vi teaplatel(); ) void IE_EvβVlLβaveMββting::action() ( vi teaplate2(); } void ΣE EveVΣReenterMeβting::action() { vi_tβ__-platβ2(); ) void ΣE_EveVlDropParticipant::ac ion() . (void) Conv->BufToCARD32(data+pos, res_len, nbytes, iob.eve_vi_drop_participant.vi roomjid) pos +- nbytes; "" — ~ "* (void) Conv->BufToCARD32(data+pos, res_lβn, nbytes, iob.βve_vi_drop_partieipant.participan pos +- nbytes; RMgr->fire_VI(iob.eve vi_droρ_ρarticipant.vi rooa id, iob); } void IE_EveVIDe3troyMeeting::action() { (void) Conv->BufToCΛRD32(data+pos, res_len, nbytes, iob.etβrl.pseudo_id) ; pos +- nbytes; RMgr->firβ_VI(iob.eterl.pseudo_id, iob) ; ) void IE EveVXSusp—dHsiting::action() « (void) Conv->BufToC*RD32(data+pos, res_lβn, nbytes, ~ " iob.βve_vi_suspβnd j neβting.vi_room_id) pos +- nbytes; RMgr->firβ_VI{iob.βvβ_vi_suspendjιιββting.vi_roαα_id, iob) ; ) void IE EvβVIRβsuaβMeβting::action() { (void) Conv->BufToCARD32(data+pos, rβs_len, nbytes, iob.βvβ_vi_suspβnd_aββting.vi_room_ιd ) pos +- nbytes; RMgr->firβ_VI(iob.evβ_vi_suspend_meeting.vi_room_id, iob ) ; void ΣE_BveVlLlstRooas::action() { RMgr->Coatrol()->*mgr()->LiatRooas(RMgr->NβxtSeqHo() ) ; void IE EveV ListMeβtingβ::action() RMgr->Control()->MRMgr()->ListMβetings<RMgr->NertSeqSo()); void IE EveVIShowMβetingStatua::action() { int aeet id; (void) Conv->BufToCλRD32(data+poa, rea_len, nbytes, saet_id) ; pos +- nbytes; ~ RMgr->Control()->MRMgr()->ShowMeetingStatus(RMgr->Nes SeqNo(), } void ΣE'EveVTShowMβetRooaStatus::action() { int meet id; (void) Conv>BufToCΛRD32 (data+pos, res_len, nbytes, aeβt_id) ; pos +- nbytes; RMgr->Control ( ) ->MRMgr ( ) ->ShowMβetRooaStatus (RMgr->NextSeqNo ( ) , ) void ΣE Eve VTΛddSβrver: : action () { (void) Conv->BufToCARD32 (data+pos, res_len, nbytes, " ~ iob.βvβ_vi_add_sβrver.vi_room_id) ; pos +- nbytes; iob.βve_vi_add_sβrvβr.med.m - (Media) data(pos++]; (void) Conv->BufToString(data+pos, res_len, nbytes, — iob.βvβ_vi_add_sβrvβr.med.ud pos +- nbytes; ♦ifdef DEBUG cout « "ΣE_EvβVIAddServer: " « (int)iob.βvβ_vi_add_sβrver.mβd.m ~ « ■ Udesc: " « iob.βvβ_vi_add_servβr.med.udesc « endl ; ♦endif /* FOR THE MOMENT ADD_SERVER to ALL int list len - 0; (void) Conv->BufToCARD32(data+pos, rβs_len, nbytes, list_l β n ) ; pos +- nbytes; for (int i - 0; i < list_lβn; i++) I int part; (void) Conv->BufToCARD32(data+pos, rβs_lβn, nbytes, part ) ; pos +- nbytes; iob.βvβ_vi_add_sβrver.part_list.insβrt_nβrt(part ) ; */ RHgr->firβ_VΣ(iob.βvβ_vi_add_sβrver.vi_roαm_id, iob ) ; } void IE_EvβVTDropServer::action() ( void) Conv->BufToCARD32(data+pos, res_len, nbytes, iob. β v β _vi_drop_sβrver.vι_room_ιd) ; pos +■ nbytes; iob. β ve_vi_drop_s β rver.aβd.a - (Media) data (poβ++] ; ( void ) Conv->BufToString (data+pos, rββ_lβn, nbytes, iob. β ve_vi drop server. aed. udesc) ; pos +» nbytes; ~ * ♦ifdef DEBUG eout « "XB_BveVIDropServer: ■ « (int) iob.βve_vi_drop_server. BB d.a « • Udesc: " « iob. eve vi drop server .aed. udesc « endl; ♦endif "" "~ "" RMgr->fir β _vχ ( iob.βve vi_drop_sβrver.vi rooa id, iob); . ~ ~ void ΣR_v∑MββtingΣnvitation::aetion() { (void) Conv->BufToCARD32(data+poa, rβa_lea, nbytes, iob.Rep rijaβeting invitation. i room pos +» nbytes; — — — (void) Conv->BufToCARD32(data+pos, res_len, nbytes, list_lβn) ; pos +» nbytes; ~~ for (int i - 0; i < list_lβn; i++) { a - (Media) data(pos++]; (void) Conv->BufToString(data+pos, res_len, nbytes, udesc); pos +- nbytes; ~~ iob.Rep vi aeeting invitation.aed.add(m, udesc) ; ) RMgr->fire using_seqno(asg seqjio(), iob) ; } REPLIES FROM MR TO CM void IR_CrβatβRooa: :action() ( (void) Conv->BufToCARD32 (data+pos, res_len, nbytes, iob.Rβp_mr_crβate_room.room_id) ; pos +- nbytes; RMgr->firβ_using_sβqno(msg_seq_no() , iob) ; } void IR_CreateMeeting::action() (void) Conv->BufToCARD32(data+pos, res_lβn, nbytes, iob.R β p_mr_creatβ_meβting.aeeting_xd) pos +- nbytes; RMgr->firβ_using_sβqno(msg_seq_no() , iob) ; ) void IR XddSβrvβr::action() pos++; // ignore first field if (Conv->BufToString(data+pos, res_len, nbytes, iob.Rep_mr_add_server.machine) < 0) ( return; } pos +- nbytes; ( void ) Conv->BufToCARD32(data+pos, res_len, nbytes, 1 iob.Rβp_mr_add_server.port) ; pos +- nbytes; RMgr->f ir β _us ' ing_sβqno (msg_sβq_no ( ) , iob ) ; void XR ListSβrvers: :aetion<) { int list len; Media m;~ String machine, udesc; int port; ( void ) Conv->BufToCARD32 (data+pos, res_lβn, nbytes, list len) ; poβ +- nbytes; "" "" for (int i - 0; i < list_len; i++) { a - (Media) dataTpos++}; (void) Conv->BufToString(data+pos, res_len, nbytes, udesc) ; pos +- nbytes; "" (void ) Conv->BufToStrin (data+pos, rβa_len, nbytes, machine); pos +» nbytes; "" (void) Conv->BufToCλRD32 (data+pos, res_len, nbytes, port) ; pos +- nbytes; " ~ iob.Rep_list_servers.mβd.add(m, udesc); iob.Rβp_list_sβrvβrs.med.update(m, machine, port); } RMgr->firβ_using_sβqno(msg_sβq_no() , iob) ; ) void XR GβtPβrsonlnfo::action() ( int 11, id; String partjnaae, duaay; (void) Conv->BufToCARD32(data+pos, res_lβn, nbytes, id); pos +- nbytes; if (Conv->BufToString(data+pos, res_len, nbytes, part_nasα) < 0) { return; } pos +- nbytes; // list lβngthl (void) Conv->BufToCARD32(data+pos, res_len, nbytes, 11); pos +- nbytes ; if (11 <- 0) return; // right now read just the first record if (Conv->BufToString(data+pos, res_lβn, nbytes, iob.Rβp_rβg_gβt_pβrson_info.machine) < 0) { return; 1 pos +- nbytes; (void) Conv->BufToCARD32(data+pos, rβs_lβn, nbytes, iob.Rβp_rβg_get_pβrson_info.port) ; pos +■ nbytes; RMgr->fire_using_sβqno(msg_seq_no() , iob) ; void IR_ListRooms: :action() RMgr->Control()->VΣMgr()->ListRooms(data, msg_len () ) ; } -d 2R_.ListMeetings: : action () RMgr->Control () ->VΣMgr()->LiatMββtings(data, aβg_lβn()) ; void XR_Sho«MβetiagStatua::aetion() RMgr->Control () ->VHigr()->ShoeMβetingStatua(data, aβg lβn()) ; void ΣR_ShowMeetRoeαStatus::ac ion() RMgr^>Control () ->VIMgr()->ShowMeβtRooastatus(data, asg_lβa() ) ; /////////// EVENTS FROM EVEJrøTXFΣER TO CM void ΣE EveMeβ inglnvite::action() (void ) Conv->BufToCARD32(data+pos, res_lβn, nbytes, iob.evβ_aββting_invitβ.participant) ; pos +- nbytes; "* (void) Conv->BufToString(data+pos, res_lβn, nbytes, iob.eve_aeeting_invite.partjiame); pos +- nbytes; — ~ (void) Conv->BufToCARD32(data+pos, res_lβn, nbytes, iob.eve_aeeting_invite.rooa_id) ; pos +- nbytes; "* ~~ (void) Conv->BufToCARD32(data+pos, res_lβn, nbytes, iob.βvβ_ι__eβting_invitβ.meeting_id); pos +- nbytes; "* "" int list_len - 0; Media a~ String udesc; (void) Conv->BufToCARD32(data+pos, res_len, nbytes, list_lβn) ; pos +- nbytes; ~ ♦ifdef DEBUG eout « "Received IEJEvβMββtinglnvite : Part: " « iob.eve aeetXng_invite.participant « " Rooa: " « iob.βvβ_eββting_invitβ.rooa_id « " Listlβn: " « list_len «endl ; ♦endif ~ for (int i - 0; i < list_lβn; i++) ( a - (Media) data[pos++.; (void) Conv->Bu«ToString(data+poa, rβs_lβn, nbytes, udesc ); pos +- nbytes; ♦ifdef DEBUG cout « "Requested aed: " « (int)m « " Udesc: " « udesc « endl ; ♦endif iob.eve_aβeting_invite.med.add(m, udesc) ; ) PartMediaBridgeDβseList *p; nbytes, ρm β d_l β n ) ; ( void ) Con- ->Bu£ToG_UU>32 (data+pos, res len, nbytes, part ) ; pos +- nbytes; ~ ( void ) Conv->BufToCARD32 (data+pos, ras Len, nbytes, aed len ) ; poe + » nbytββ; ~ ~ for (int j - 0; j < aedJLen; j++) { a - (Media) data [pos++] ; ( void ) Conv->BufToString (data+poa, rβs_lβn, nbytes, udesc) ; pos +- nbytes; ~ " tap aed. add (a, udesc) ; ) p - new PartMβdi sBrldgeDescList (part, ts_p j eed) , iob .βvβ _αeting_invitβ .partjaβd. insert j -βϊt (p) . J ♦ifdef DEBUG cout « "Going to CreatβNewFsM" « endl; ♦endif ' RMgr->CreateNewPSM(ROOM_UNASSΣGNED, iob. eve aaeting invite. rooa id, ~ iob " ; " " void IE EvβSβrverAdded::action() { tβ-J_plate7(); ) void ΣEJSveServerDropped: :action() t templatβ70 ; ) void IE EveAddedParticipant: :aetion() ( int src; ♦ifdef DEBUG cout « "Received ΣEJBveAddedParticipant" « endl; ♦endif ~ (void) Conv->BufToCARD32(data+pos, res_len, nbytes, sre ) ; pos +- nbytes; (void) Conv->BufToCARD32(data+pos, rβs_lβn, nbytes, iob.βve_addβd_par icipant.room_id) ; pos +- nbytes; ( void) Conv->BufToCARD32(data+pos, res_lβn, nbytes, iob.βvβ_addβd_participant.aββting_id) ; pos +■ nbytes; ( void) Conv->BufToCARD32(data+pos, rβs_len, nbytes, iob.ev β _add β d_participant.participant) ; pos +- nbytes; int list_len - 0; Media m; String udesc machine; int port; ( void ) Conv->BufToCARD32(data+poa, res len, nbyteβ, list len); poβ +- nbytes; " ~ ~ for (int i - 0; t < list len; 1++) { a - (Media) dataTpoa++]; ( void ) Conv->BnfToString(data+poa, res len, nbytes, udesc); pos +- nbytes; ~ ( void ) Conv->BufToString(data+pos, res len, nbytes, machine); pos +-> nbytes; ~ ( void ) Conv->BufToCARD32(data+poa, res len, nbytes, port) ; pos +-> nbytes; " ~ ♦ifdef DEBUG cout « "ΣEJBv AddβdPart: Mach: " « aachine « • " « port « endl; ♦endif iob.eve_added_partieipant.aed.add(a, udeae); iob.eve_added_participant.aed.update(a, machine, port); ) ' RMgr->firo(iob.eve addedparticipant.rooα id, iob); ) void ΣE_EveAccβptInvitation::action() { int src, meetingjld; ♦ifdef DEBUG eout « "Received IE Eveλeeeptlnvitation" « endl; ♦endif (void) Conv->BufToCARD32(data+pos, res_lβn, nbytes, src); pos +<■ nbytes; (void) Conv->BufToCARD32(data+pos, rea_len, nbytes, iob.βve_aeeeρt_in—ita ion.room_id); pos +- nbytes; (void) Conv->BufToCARD32(data+pos, res_len, nbytes, mββting_id) ; pos +-< nbytes; int list_lβn - 0; (voi d ) C onv-> B ufToCARD32(data+pos, res_lβn, nbytes, list_len ) ; pos +- nbytes; for (int i - 0; i < list_lβn; i++) { a - (Media) dataTpos++]; (void) Conv->BufToString(data+poa, rβs_lβn, nbytes, udesc ) ; pee +- nbytes; iob.eve accept_invitation.aβd.add(a, udesc); ) RMgr-> irβ ( io b .βvβ_aceept_invitation.rooa_id, iob); void ΣE_EvβMββtingDβstroyed::action() templatβ2(); void IE_EvβMββtingRβsumβd::action() template2() ; void XE_BveJoinMββting::action() { template*<>; . void IE_EveMβeting β uspβnded::action() { tβaplate (); ) void ΣE_EvβRβjβetΣnvitation::action() ( tβaplate20 ; } void ΣE_BvβDroppedParticipant::action() { teaplatel0; > void IE EvβRoomDestroyβd::action() { teaplateSO; ) void IE_EveJoinMeetingRe eeted::action() { teaplateSO; ) void IE EvoRβenterMeeting::ac ion() { // tβmplatββO; teaplatel(); ) void ΣE EvβLβftMββting::action() ( // templateβO; templatβl(); ) // Events from Local Media Managers void IE EvβLMUp::action() { Media m; String udesc; m - (Media) datatpos++]; (void) Conv->BufToString(data+pos, rβs_lβn, nbytes, udesc); pos +- nbyteβ; ♦ifdef DEBUG cout « "Rβcβvd from 1M: " « (int) m « - Desc: " « udesc « endl ; ♦endif if (Invo_eβr->objβet_type() !- β_LM) return; LocalMedia *la - (LocalMedia*) Invoker; lm->update(m, udesc); } void IE EvβLMStatβChangβ: :action() { int state; ( void ) Conv->BufToCARD32 (data+pos, rβs_lβn, nbytes, state) ; pos + « • nbytes; ~ if (lnvoker->objeet_typβ () !- e_LM) return; ~~ — LocalMedia *lm - (LocalMedia*) Invoker; if (state) la->s β t_aetivβ (> ; else la_->set_inactivβ(); . ♦define DEBUG 1 ♦include <controller.h> ♦include <state.h> ♦include <conn.h> Blockimplβment(char) int Connection::hβader_lβn - MSG_HEΛDER_LEN; Connection::Connection(Controller *ctrl, MnConneetion pconn, ConnectionObjectTypes < Ctrl - Ctrl; alive - 1; conn - pconn; obj type - otype; ) void Connection::elient_dead() { alive - 0; ) int Connection::send(ehar *data, int len) { if (conn->IsAssigned() —- MmEnum::M-nFalse) { deactivate_self() ; return(-1) ; > if (NW->»iritβ(conn, data, len) < len) { deaetivatβjself() ; return(-1)7 ) return(0) ; int Connection::send(Message *asg) { if (conn->l3 Assigned 0 — leaEnum: :MmFalse) { deaetivate_self () ; return (-1) ; if ( N W ->Write(conn, msg->msg_headβr(), msg->msg_hβad β r_l β n () ) < msg->msg_header_len()) ( deactivate_self() ; return(-1) ; if ( NW->Nrite ( conn, msg->msg_data() , msg->msg_lβn()) < msg->msg_len () ) { deaetivate_sel () ; return(-1) ; ) return(0) ; ) void Connection::clieht_process msg() { CARDS type, opcode; CARD32 aβg_seq, asg lan; IncoaingMeaaage *asg; if (NW->Rβad(header, header len) < header len) { ♦ifdef DEBUG ~ ~ cerr « "CM: Read Error: : • « FILE « " ■ « (int) LΣNE « endl ♦endif — dβaetivate_self(); return; " ~ ) Ctrl->Proto()->interprβt header(header, type, opeode, asg seq, asg len); ♦ifdef DEBUG ~ ~ cerr « " CM: Len:" « asg_len « " Seq:" « asg seq « " Type: " « (int)type « " Opcode: • « (intTopcodβ « endl; cerr.flush() ; ♦endif if (asg_len > 0) ( buf.reserve(msg_lβn); if (NW->Read(buf, msg len) < msg len) { ♦ifdef DEBUG " "" cerr « "CM: Read Error:: ■ « FILE « " ■ « (int) LINE_ ♦endif deactivate_sβlf() ; return; ) ) msg - Ctrl->Proto()->constructjnsg(type, opeode, msg_seq, msg_len, if (msg) { msg->action() ; delete msg; ) ) // client_procβss_msg Connection: :-Connection() { (void) NW->HangUp(connection0 ) ; > ♦define DEBUG 1 ♦define DEFAULT_HOBT "spider" ♦include <controllβr.h> ♦include <conn.h> ♦include <sysent.h> ♦include <stdlib.h> ♦include <statβ.h> ♦include <obj_man.h> ♦include <3ignal.h> Controller *G_Controllβr; void alarajiandler<) if ( G Controller 44 G_Controller->RoomManagβr() ) { ~ G Controller->RooxDManager()->alarm_handlβr () ; } ) main(int argc, char *hrgv[]) GjController * new Controller0 ; (void) signal(SΣGALRM, (SIG_TTP)alara_handlβr); G_ControUer->atartup(argc, argv) ; G~Controllβr->listβn(); G~ControHβr->βain loopO; } void Controller: :startup (int argc, ehar **argv) { int c; extern ehar *optarg; extern int optind; char naas (DUMKr_STR_SΣZE] ; s_y_id ■ -1; my_namβ - ■• ; MRjaaehinβ - DETADLT_HOST; ' EN~machinβ - DEFAULT- HOST; Vljport - CM VI PORT? MR_port - MR_CLΪTACE_PORT; LM_port - CM_LMAN_PORT; EN_port - EN_CM_PORT; while ( (c - getopt (arge, argv, -M:m:v:l :E:β:i:N: ") ) !- -1) { switch (e) ( eaae * V : VX_port - atoi (optarg) ; break; ease ' i' : my_id - atoi (optarg) ; break; ease 'N' : strcpy(naae, optarg); myjnaae - naaβ; break; eaae 'M' : strcpy(naae, optarg) ; MR j nachine » naae; break; eaae 'E' : strcpy(naae, optarg); EH aachine - Mt_port - atoi(optarg). break; ease '1': I_M_ ort - atoi(optarg); break; EN_port - atoi(optarg) . break; default: cout « "Usage: cm [-N <naaβ>] [-i <id>] .-v <vi_po exit(l); > if (!(RMgr - new Roo_-_FssMgr(this, Myid())))( cout « "Fatal Mβαory Alloc. Error: " « FI L E « ■•- « __LIlβ__ « endl; exit(1); ) if (! (Con-Methods - new Convert())) { eout « -Fatal Maaory Alloc. Error: ■ « FILE « ":" « LINE « endl; exit(l); ~ " " " } if (! (Prot - new Protocol(this))) { cout « "Fatal Meaory Alloc. Error: " « FILE « ":" « LΣME « endl; exitU); ) if ( !(_MRMgr - new MRServerManager(this, MR aachine, MR_port))) { eout « "Fatal Maaory Alloc. Error: ■ « ~ FILE « •:" « endl; if {! (_ENMgr - new EvβntNotifierManager(this, ENjnachine, EN_port>)) ( cout « "Fatal Maaory Alloc. Error: " « FILE « ":" « LINE__ « endl; exit(1) ; > if (! (_VlMgr - new Visuallntar aeeManager( his))) { cout "" « "Fatal Meaory Alloc. Error: " « FILE « ": ■ « endl; if ( ! ( LMtgr - new LocalMediaManager (this) ) ) { cout-« "Fatal Maaory Alloc. Error: " « FILE « ■ : " « LINE__ « endl; exit (l) ; } ) void Controller::listen() { if (NW->ActivatβSβrverPort(VI_ ort) !- MmEnu ::MaOK) ( cout « "Cannot open VΣ listening port...\n"; eout.flush() ; ) if (NM->AetivatβSβrvβrPort(LM_port) !- Mβ-Enum::10.0K) ( eout « "Cannot open Local Media Managers' port...\n"; cout. lushO ; ) ( void Controller::main_loop () { for (;;) { if (NM->Seleet () ! - MtnEnum: :MαOK) continue; if (NW->CurrentConnection ( ) ->ServβrPort ( ) — MR_port ) _MRMgr->ρrocess (NW-x;urrentConnβction ( ) ) ; else if ( *»-> C urrentConn β etion ( >->Sβr*«rPort () — T por t ) _ V IMyr->p roc β as (H»->CurreatConnβetion ( ) ) ; "^ else if ( MW->CnrrentConnect ion ( ) ->ServerPort ( ) — LM _por t ) _IJMgr->proces8 (NlfOCurrentConnection () ) ; else if 0»-> C urrentConn β ction()->sβrverPort () «— EN_port) •*■* process ( NW->currentConaection() ) ; 1 Controller::-Controller() { if (Prot) delete Prot ; if (RMgr) delete RMgr; if (jMRMgr) delete MRMgr; if ( LMMgr) delete J-tMgr; if (_ENMgr) delete εmgr; if ( VIMgr) delete " v∑Mgr; ) void CM shutdown() { if (G Controller) delete G_Controller; exit(ϊ); } ♦include <iostreaa.h> ♦include <gβnβrator.h> IncomingMessage * default_genβrator(CARDS type, CARDS opcode, CARD32 seq, CARD32 len, char "data. Connection *invoker) i cerr « "Illegal Message or Message not implβeαnted: Type:" « (int)type « " Code:" « (int)opcode « endl; eerr.flush ; return(new IllegalMessage(type, opcode, seq, len, data, invoker)); } IncomingMessage* Gen_ErrMsg( CARDS type, CARDS opcode, CARD32 seq, ~ CARD32 len, char *data. Connection » invoker) { return(new IncoaingError(type, opeode, seq, len, data, invoker)); ) IncomingMessage* Gen IR_CreateRooa( CARDS type, CARDS opcode, CARD32 seq, "" CARD32 len, char *data. Connection *invoker) return(new IR_CreateRooa(type, opcode, seq, len, data, invoker )) : ) IncomingMessage* Gea ΣR_DββtroyRoom( CARDS type, CARDS opcode, C4RD32 seq, " " CARD32 len, char *data Connection *invok» ) return(new ΣR._DestroyRooa(type, opcode, seq, len, data, invoker )) ) IncomingMessage* Gen lR_CrβateMββting( CARDS type, CMED8 t_ρeod β , CARD32 seq, CARD32 len, char *data, Coanaetioa *invok β r ) return ( new lR_CrβatβMββting(typβ, opcode, seq, len, data, invoker )) ; ) IncoaingM β ssage* Gen IR DestroyMeeting( CARDS type, CARDS opeode, CARD32 seq, ~ CARD32 len, char *data. Connection *invoker ) { return ( new IR_DestroyMββting(typβ, opcode, seq, len, data, invoker ) ); ) IneoaingMeasage* G β n lR_AddServβr( CARDS type, CARDS opcode, CARD32 seq, CARD32 len, ehar *data. Connection "invoker) return ( new ∑R_AddSβrvar<type, opcode, seq, len, data, invoker) ) ; ΣneoαingM β ssage* Gaa πijDropServer( CARDS type, CARDS opcode, CARD32 seq, CΛRD32 len, char *data. Connection "invoker) return ( new IR_DropS β rv β r(type, opcode, seq, len, data, invoker)); IncomingMessage* G β n_IR_Ad-lPartieipant( CARD8 type, CARDS opcode, CARD32 seq, CARD32 len, char *data. Connection -invoker) return ( new ΣR_.AddParticipant(type, opcode, seq, len, data, invoker)); IneoaingMeasage* Gβn_IR_DropParticipant( CARD8 type, CARDS opcode, CARD32 seq, ~CARD32 len, char *data. Connection "invoker) { return(new ΣR_DropParticipant(type, opcode, seq, len, data, invoker)); I IncomingMessage* Gen_IR_ListRooas( CARD8 type, CARDS opeode, CARD32 seq, ~CARD32 len, char *data. Connection *invoker) ( return(new IR ListRooas(type, opcode, seq, len, data, invoker)); ) IncoaingMeβsagβ* Gβn_IR_ListMβetings( CARD8 type, CARD8 opeode, CARD32 seq, ~ ~ " CARD32 len, char "data. Connection *invoker) { return (new IR_ListMββtings (type, opcode, seq, len, data, invoker) ) ; } IncomingMessage* Gβn_IR_ListSβrvβrs ( CARDS type, CARDS opcode, CARD32 seq, " ~CARD32 len, ehar *data. Connection * invoker) I return (new IR_. ListSβrvβrs (typβ, opcode, seq, len, data, invoker) ) ; ) Incoming M essage* Gβn_ΣR LβavβMeβting ( CARD8 type, CARDS opcode, CARD32 seq, ~CARD32 len, char *data. Connection * invoker) return (new IR_LβaveMeeting (type, opcode, seq, len, data, invoker ) ) ; } IncomingMessage* Gen IR_ReβntβrMeβting ( CARD8 type, CARDS opcode, CARD32 seq, — CARD32 len, char *data. Connection *invok β r ) re t urn (new IR_ R eentβrMββt ing (type, opcode, a-»^ f len, data, invoker ) ) ; } ~ * Incoming M essage* G βn_IR_SuspβndMββting ( CARD8 type, CARDS opcode, CARD32 seq, C A RD32 len, ehar *data, Connection "invoker) return ( new lR_SuspβndMβet ing (type, opcode, seq, len, data, invoker ) ) ; ) IncomingMessage* Gen XR_RβsuaβMeeting I CARDβ type, CARDS opcode, CARD32 seq, "~ CARD32 len, char *data. Connection *invok β r ) return ( new IR_ R βsuaβMββt ing (type, opcode, seq, len, data, invoker ) ) ; } Ine β aiagM β ssage* β en_ΣR_ ββ tPβrsonIn o( CARDS type, CARDS opcode, CARD32 seq, CARD32 len, ehar *data. Connection *invokβr) return ( new IR_G β t» β rsonInfo(type, opeode, aeq, len, data, invoker)); IncomingMessage* 6an_XR_V∑MeβtingInvitation( CARDS type, CARDS opcode, CARD32 seq, CARD32 lea, char *data. Connection *invokβr) return ( new XR_vlMe β tingInvitation(type, opcode, aeq, len, data, invoker)); IncomingMessage* Gea_XE_EveCreateMeeting( CARDS type, CARDS opcode, CARD32 seq, CARD32 len, char "data, Connection *invoker) { return(new IE_EveCreateMβeting(type, opcode, seq, len, data, invoker)); . IncomingMessage* Gen_IE_EveCreatePersistentM8βting( CARDS type, CARDS opcode, CARD32 CARD32 len, char 'data. Connection "invoker) { return(new IE EvβCreatePβrsistentMβeting(type, opcode, seq, len, data, invoke ) IncomingMessage* Gen_IE_EveVΣCreateMeβtInERoom( CARD8 type, CARDS opcode, CARD32 seq, CARD32 len, ehar *data. Connection *invoker) { return(new IE EveVXCrβateMeetΣnERoom(type, opeode, seq, len, data, invoker)); ) IncomingMessage* Gβn_IE_EveVΣJoinMββting( CARDS type, CARDS opcode, CARD32 seq, ~~ ~CARD32 len, ehar *data. Connection *invoker) { return(new IE EveVXJoinMeeting(type, opeode, seq, len, data, invoker) ) ; ) IncomingMessage* Gen_IE_EveV ShowMββtingStatus( CARD8 type, CARD8 opcode, CARD32 seq, ~ CARD32 len, char *data, Connection *invoker) return(new lE_EvβVIShowMββtingStatus(type, opcode, seq, len, data, invoker )) ; ) IncomingMessage* Gβn_IE EveV ShowMeβtRooaStatus( CARDS type, CARD8 opcode, CAFD32 se ~CARD32 len, char *data. Connection *invoker) return(new IE EveV ShosMβetRoomStatus(type, opcode, seq, len, data, invoker )) IncomingMessage* Gen IR ShowMeetingStatus( CARD8 type, CARD8 opcode, CARD32 seq, "~ ~CARD32 len, char *data. Connection *invoker ) return ( new ∑R_ShowMββtingStatus(type, opcode, seq, len, data, invoker )) ; ) IncomingMessage* Gen IR_ShowMβetRoomStatus( CARD8 type, CARDS opcode, CARD32 seq, CARD32 len, char *data. Connection *invok β r ) return ( new ΣR_ShowMeetRoomStatus(type, opcode, seq, len, data, invoker )) ; } IncomingMessage* Gen IE BveVIAddParticipan ( CARDS type, CARDS opcode, CARD32 seq, "" CARD32 len, char *data. Connection *invok β r ) return ( new IE_Ev β VIAddParticipant(type, opcode, seq, len, data, invoker )) ; } ZneαaiagM β ssage" ββ n_XB_BveVXDropPartieipan < CARDS type, CARDS opcode, CARD32 seo CARD32 len, char *data. Connection *invokβr) return ( new I»_lvevTDropParticipant(type, opeode, aeq, len, data, invoker )) ; IneoaingMeasage* Q n_IE_EveVISua F enca«βetin ( CARDS type, CARDS opeode, CARD32 seq, CARD32 len, char "data. Connection *invokβr) return ( new IE_Ev β VTSuap β ndMe β ting(type, opcode, aeq, lea, data, invoker)); laeo β iagM β aaage* Gen_ΣE_EveVXReenterMeeting( CARDS type, CARDS opcode, CARD32 seq, CARD32 len, ehar "data. Connection *invokβr) return ( new IE_Ev β VTRββntβrMββting(type, opcode, seq, len, data, invoker)); IncomingMessage* Gen_ΣE_EveVILeaveMeeting( CARDS type, CARDS opeode, CARD32 seq, CARD32 len, ehar "data, Connection "invoker) return(new XE_EvβVXLeaveMeeting(type, opeode, seq, len, data, invoker)); IncomingMessage* Gβn_IE_BvβVIAddSβrver( CARD8 type, CARDS opeode, CARD32 seq, CARD32 len, char "data, Connection "invoker) return(new IE_EveVIAddServer(type, opcode, seq, len, data, invoker) ) ; IncomingMessage* Gen_IE_BveVTDropServer( CARDS type, CARD8 opcode, CARD32 seq, CARD32 len, char *data. Connection *invoker) return(new lEJSveVlDropServer(type, opcode, seq, len, data, invoker)) ; IncomingMessage* Gen_ΣE_EveVTDestroyMeeting( CARDS type, CARDS opeode, CARD32 seq, _ CARD32 len, ehar "data. Connection "invoker) return(new IE_EveVIDeatroyMβeting(type, opeode, seq, len, data, invoker ) ); IncomingMessage* Gen IE EvβVTListRooms( CARDS type, CARD8 opcode, CARD32 seq, ~ ~CARD32 len, char "data. Connection "invoker) return(new IE_EvβVIListRooas(type, opcode, seq, len, data, invoker )); IncomingMessage* Gen IE BveV ListMββtings( CARD8 type, CARDS opcode, CARD32 seq, ~ ~CARD32 len, ehar "data, Connection "invoker) return(new lE_EvβVII-istMeβtings(type, opeode, seq, len, data, invoker )); IncomingMessage* Gβn_IE_EvβVTGetPβrsonNamβ( CARDS type, CARDS opcode, CARD32 seq, CARD32 len, char "data, Connection *invoker ) return ( new ΣE_EvβVTGβtPersonNamβ(typβ, opcode, seq, len, data, invoker )); IncomingMessage* Gen_IE_EvβVIGβtPβrsonImagβ( CARD8 type, CARD8 opeode, CARD32 s " rCAiβRDn3w2 l._e»n-,. fchtinarr ""ddaattaa,. CCoonnnneeccttiioonn ""iinnvvookkeerr) ) return i < ( new IE_Ev β VIGetPersonΣmage(type, opcode, seq, len, data, invoker )); } IneαaingMeaaage* Gen_ΣE_BveVX β etPeraonId( CARDS type, CARDS opeode, CARD32 seq CARD32 len, char "data. Connection *invoker) return ( new XEJ*v β TG β tP β raonId(type, opcode, aeq, len, data, invoker) ); ΣneoaingMessage* G β n_XE_BvβvTUp( CARDS type, CARDS opeode, CARD32 seq, CΛRD32 len, char *data. Connection *invokβr) return ( new ΣE_Ev β VXUp(typβ, opeode, amq, len, data, invoker)); IncoaingMessage* Gen_IE_EveVXDown( CARDS type, CARDS opeode, CARD32 seq, CARD32 len, char *data. Connection "invoker) return ( new IE_Ev β VIDown(typβ, opeode, seq, len, data, invoker)); IncomingMessage* G β n_ΣE_EveVIJoinMββtingAccβρtβd( CARDS type, CARDS opcode, CARD32 s CARD32 len, char "data, Connection "invoker) { return(new ΣE_EveVIJoinMeetingAceβpted(type, opeode, seq, len, data, invoker } IncomingMessage* Gen_ΣE_BveVΣJoinMeβtingRejected( CARD8 type, CARD8 opcode, CARD32 s CARD32 len, ehar "data, Connection "invoker) ( return(new IE EveVIJoinMeetingRejected(type, opcode, seq, len, data, invoker } IncomingMessage* Gen_ΣE_EveVIShowAssocRooa( CARDS type, CARDS opcode, CARD32 seq, ~ " CARD32 len, char "data. Connection "invoker) { return(new IE BveVIShowAssocRooα(type, opcode, seq, len, data, invoker)); ) IncomingMessage* Gen_IE_EvβVΣResuaβMeeting( CARD8 type, CARD8 opcode, CARD32 seq, CARD32 len, ehar *data. Connection "invoker) { return(new lEJEveVIRβsumβMββting(type, opcode, seq, len, data, invoker)); } IncomingMessage* Gβn_IE_EvβMeβtingΣnvitβ( CARD8 type, CARDS opeode, CARD32 seq, CARD32 len, char "data, Connection "invoker) return(new IE EveMβetinglnvite(type, opcode, seq, len, data, invoker ) ) ; } IncomingMessage" Gen ΣE EvβAceβptΣnvitation( CARD8 type, CARDS opcode, CARD32 seq, "~ -CARD32 len, char *data. Connection *invokβr) return(new ΣE_BveAceβρtInvitation(type, opcode, seq, len, data, invoker )) ; IncomingMessage* Gen IE EveRβ βetInvitation( CARD8 type, CARD8 opcode, CARD32 seq, ~ " — CARD32 len, char "data. Connection "invoker ) return ( new ΣE_EvβRβjβctlnvitation(type, opcode, seq, len, data, invoker )) ; ) IncomingMessage* Gβn_IE_EvβSβrverAddβd( CARD8 type, CARD8 opcode, CARD32 seq, CARD32 len, char "data. Connection *invoker ) return ( new IE EvβSβrverAddβd(typβ, opcode, seq, len, data, invoker )); IneoaingMeasage* G β n_lB_EveS β rv β xDropped( CARDS type, CARDS opeode, CARD32 sea CARD32 len, char "data. Connection *invokβr) return( H_lιe β « ιOtopp«i ( t p«, opeode, seq, len, data, invoker )) ; ∑ncoaingMeasage * G β n_XE_EveRooaD β stroyed( CARDS type, CARDS opeode, CARD32 seq, CARD32 len, ehar "data. Connection *invokβr) return ( new IE_EveRooaD β atroyed(typβ, opcode, seq, len, data, invoker)); IncomingMessage * Gen_IE_Ew β ll β etingDestroyed( CARDS two, CARDS opcode, CARD32 seq, CARD32 len, char *data. Connection *invokβr) return ( new IE_EveMe β tingDestroyed(type, opcode, seq, len, data, invoker)); IncomingMessage * G β n_IE_EveAddedParticipant( CARD8 type, CARD8 opcode, CARD32 s>a<t, CARD32 len, char "data, Connection "invoker) return(new ΣE_EveAddβdParticipant(type, opcode, seq, len, data, invoker)); IncomingMessage * G β n_ΣE_BveDroppedParticipant( CARDS type, CARD8 opcode, CARD32 seq, CΛRD32 len, char "data, Connection "invoker) return(new IE_EveDroρpβdParticipant(type, opcode, aif, len, data, invoker)); IncomingMessage * Gen_IE_EveRooml_ocked( CARDS type, CARD8 opeode, CARD32 seq, CARD32 len, ehar "data, Connection "invoker) return(new IE_EveRoomLocked(typβ, opeode, seq, len, data, invoker)); IncomingMessage * Gen_ΣE_EveRooaUnloeked( CARD8 type, CARD8 opcode, CARD32 seq, ~ CARD32 len, char "data, Connection "invoker) return(new XE_EveRooaUnloeked(type, opcode, seq, len, data, invoker)); IncomingMessage * Gen_IE_BvβLβftMeβting( CARD8 type, CARD8 opcode, CARD32 seq, CARD32 len, ehar "data. Connection "invoker) return(new ΣE_EveLβftMββting(typβ, opcode, seq, len. data, invoker )) ; IncomingMessage * Gen IE_EvβRβentβrMββting( CARD8 type, CARDS opcode, CARD32 seq, * CARD32 len, char "data. Connection "invoker) return(new IE_EveRββntβrMβeting(type, opcode, seq, len, data, invoker )); IncomingMessage * Gen_IE_EvβMeβtingSuspended( CARDS type, CARD8 opcode, CARD32 seq, CARD32 len, char "data. Connection *invok β r ) return ( new IE_EveMβetingSuspendβd(typβ, opcode, seq, len, data, invoker )); IncomingMessage * Gen_IE_EvβMeβtingResumed( CARDS type, CARD8 opcode, CARD32 seq, CARD32 len, char "data. Connection "invoker ) return ( new IE EveMβetingRβsumed(typβ, opcode, seq, len, data, invoker )); IncomingMessage * G β n_lE_BveJoinMeβting( CARDβ type, CARDS opeode, CARD32 seq, CARD32 len, char "data. Connection "invoker) return ( new IE_Ev β JoinMβ β ting(typβ, opcode, aeq, lea, data, invoker)); IncomingMessage* G β n_IE_Ev β JoinM ββ tingRβjβetβd( CARD8 type, CARDS opcode, CARD32 seq CARD32 len, char *data. Connection "invoker) return ( new IE_EveJoinM ββ tingR β jβcted(type, opcode, seq, len, data, invoker) > IncomingMessage * Gβn_ΣE_BvβI_Mϋp( CARDS type, CARDS opeode, CARD32 seq, CARD32 len, char "data. Connection *invoker) return(new IE_EveUfUp(type, opcode, seq, len, data, invoker)); IncomingMessage * Gen_ΣE_BveΣ_MStateChange( CARDS type, CARDβ opcode, CΛRD32 seq, ~ CARD32 len, char "data, Connection "invoker) return(new IE_EveLMStateChange(type, opcode, seq, len, data, invoker)); ♦include <iostreaa.h> ♦include <ioc.h> ♦include <eo_αnon.h> Listis-plβaβnt(int) List_of_pisφleaent(MediaBrldgeDesc) List_ f_piaplβaβnt(PartMediaBridgeDescList) MediaBridgeDescList: :MediaBridgeDescList() t yet to_sβrvicβ - 0; ) MediaBridgeDescList: :-MediaBridgeDescList() { MediaBrldgeDesc *b; list.reset ; while (list.next(b)) ( if (b) { delete b; ) } void MediaBridgeD β sc ist::assign_or_copy(const MβdiaBridgβDescListi rhs ) yet to service - rhs.yβt_to_sβrvιcβ; List_of_piter(MediaBrldgeDesc) tlist(rhs.list ) ; MediaBrldgeDesc *ts-p, *tmp2; // delete if there was anything already on the list list.reset() ; while (list,next(tap)) { if (tap) { list.removβ_ρrev() ; delete tmp; } ) tlist. ese (); it be tB-p->rβq_donβ??? list.insert_next(tap2); I ) MediaBridgeDescLists MediaBridgeDescLis ::operator"( const MediaBridgeDescLists rhs) { assign_or_copy(rhs); return " (*thia); ) MediaBridgeDescList::MediaBridgeDescZ_ist(const MediaBridgeDescLists rhs) { assign or_copy(rhs); } void MediaBridgeDescList::add(Media at, Strings userjdesc) I MediaBrldgeDesc "n - new MediaBrldgeDesc; if (!n) { cout « "Fatal Mem Alloc, problems : • « FILE « ■ :" « (int)_ LINE _ « endl; ) n->m • m; n->udβsc - userjdesc; n->rβq_done «• 0; n->active - 0; yβt_to_servicβ++; list.insβrt_nβxt(n); ) voi d M ediaBridgeDescList::add(MediaBridgeDescs med) ( MediaBrldgeDesc *n - new MediaBrldgeDesc; if (!n) { cout « "Fatal Mea Alloc, problems : " « FILE « ":" « (int) ^LINE__ « endl; ) n->m ■ med.a.; n->udβsc - med.udesc; n->rβq_dbnβ ■ aβd.req_don β; n->port - aβd.port; n- aachinβ - mβd.machine; n->activβ -.med.active ; yβt_to_sβrvicβ++; list.insβrt nβxt(n); ) voi d M e d iaBridgeDescList::rββ_ovβ(Media ) { MediaBrldgeDesc *b; list.reset() ; while (list. ext(b)) I if (b->m — a) { yβt_t o_service~ ; list . removβ_prev ( ) ; delete b; return; ) int MediaBridgeDescList::1sjresent(MβdiaBridgeDeae *b) MediaBrldgeDesc *t; list.reββtO; while (list.nβxt(t)) { // if ( t-α — b->a tt t->udβse — b->udeae) ( if (t->a — b->a) ( return (1) ; ) ) return(0) ; ) void MediaBridgeDescList::update(Media a. Strings aachine, int port, int is_aetive) MβdiaBridgeDesc *b; list.reset ; while (list.next(b) ) ( if (b->a — a) { b--"machine - machine; b->port - port; b->aβtivβ - is_activβ; return; "" ) ) ) void MediaBridgeDescList::update_prβv_request(Strings machine, int port, ~ int is active) { if (lastjaedia) { last_mβdia->machine - machine; last_mβdia->port - port; last_media->aetive - is_active; ) ) int MediaBridgeDescList: :next_bridge to_service(MβdiaBridgeDesc*s bridge) { MediaBrldgeDesc *b; List_of_piter (MediaBrldgeDesc) blist (list) ; blist.reset() ; while (blist.next(b) ) ( if (!b->req_dbnβ) { ; } ) return(-1) ; } void MediaBridgeDescList: :update_apρlicable_media( MediaBridgeDescLists mdesc) { List_of_piter(MediaBrldgeDesc) tlist(mdesc.list) ; MediaBrldgeDesc "tap, *taρ2, *node; tlist.reset(); while ( tlist.next(tap) ) ( if ( ( node - node_present(top))) { - tap->udβsc - node->udββc; tap->port - ■ nodβ->port; tap->aaehine - node->aachinβ; ) ) MediaBrldgeDesc* MediaBridgeDescList: :nodβ_prβsβnt(MediaBrldgeDesc *b) MedlaBridgeDesc *t; list.resβt ; while (list.next(t)) ( if (t- m — b->m) ( return (t); ) ) return(NULL) ; ♦define DEBUG 1 ♦define DUMMΪJCLΣENT 1 ♦include <controller. > ♦include <obj_man.h> ♦include <eonn.h> ♦include <iostrβam.h> ♦include <state.h> Li-St_of_piaplement(Message) Message: :Message(CARD8 asg_typ, CARDS asg_code, int msg_sβqjao, int msgJLen, char *msg_data. Connection-*invoker) { set j nsgjieadβr(msg_typ, msg_codβ, msg_seq_no, msg_len) ; setjnsgjdata(msg_data) ; ~ Invoker - invoker; RMgr - Invokβr->Control()->RoomManager{) ; Conv - lnvokβr->Control()->Conv() ; pos - 0; } n_CARD32(int lβn_in_bytβs) rep_cβil - lβn_in_bytβs%4; return((lβn_in_bytβs/4) + (rep_eβil ? 1 : 0) ) ; } ~ ~ void Message: :send() { (void) Invokβr->sβnd (header, msg_headβr_len ( ) ) ; if (len) (void) Invokβr->sβnd (data, len) ; ) void OutgoingBrror: : succβss_rβturn (CARD32 err_typβ, CARD32 msg_code, CARD32 seqjno) set j asg_hβadβr (err_typβ, msg_code, seq_no, 0) ; sendO ; } void OutgoingBrror:: β _actioa(CARD32 βrr_typβ, CARD32 asg_eodβ, CARD32 8βq_no, CARD32 err_eod 3 β t_asg_h ββ d β r ( errjype, asg_codβ, seq_no, siiβof(int)); Conv->IntToeu (err_eode, ( (char •)rep buf)); set_asg_data((char " *)rβpjbu ); "* sendO; " ~ ) void IncomingReply::action() ( RMgr->firβ using seqno(asg seq.no(), iob); ) ♦include <obj_aan.h> ♦include <ea_aag.h> ♦include <outgoing.h> List_of_pi_apleaent(LocalMedia) lllll LocalMediaManager Methods void LocalMediaManager::process(MmConnection pconn) { List of_piter(LocalMedia) elist(cliβnt_list) ; LocalMedia *obj; clist.reset(); while (clist.nex (ob )) { // check creation if (obj->connection() — pconn) ( obj->process_asg(); garbage_collect() ; return; ) if (streap(pconn->NaaαTag(), "")) return; // Not a new client if ((obj - new LocalMedia(Ctrl, pconn)) — NULL) l cout « "Fatal Mea. Allocation Error " « FILE « " " « ■ LIME " « endl; return; ) clist.insert next(obj); obj->proceββ j asg(); 1 LocalMedia* LocalMediaManager::find_aatching_I_ (Media a. Strings udesc ) { LocalMedia "la; List_of_pitβr(LocalMedia) clist(client_list ) ; clist.reset ; while (clist.next(la)) { // if (la->is j natch(a, udesc)) if (lm->is_aatch(a ) return lm; ) return(NULL) ; ^ _ n 2-.0 old LocalMediaManager::ConnectToBridge<int room_id. Media a. Strings udesc, Strings aachine, int port) LocalMedia "la; ♦ifdef DEBUG eout « "Before sending ConnβctToBridgβ aeg: " « (int)a « ■ desc: " « udesc « " bridge_addr is • « aachine « "::" « port « en ♦endif if ((la - find_aatehing_LM(a, udesc) )> { OE_EveConnβetToBridge *eve; eve - new OE_BveConneetToBridge(0, 0, NULL, la); if Cove) return; βve->action(rooa_id, aachine, port) ; ♦ifdef DEBUG ~ eout « "Sent ConnβctToBridgβ asg: " « (int)a « " dese: " « udesc « " bridge addr is " « aachine « "::" « port « en ♦endif . delete eve; } void LocalMediaManager::DiseonnectFroaBridge(int room_id. Madia m. Strings udesc, Strings machine, int port) I LocalMedia *la; if {(la - find_matehing_LM(m, udesc))) { OE_EveDiseonneetFromBridge *m; m - new OE_EveDisconnectFroaBridge(0, 0, NULL, la); if (!a) return; m->action(room_id, machine, port); delete m; 1 } void LocalMediaManager: :garbage_collβet() { List_of_piter (LocalMedia) clist (client_list) ; LocalMedia "obj; clist.reset0 ; while (clist.next(obj)) { if (!obj->is_alivβ() M delete obj; clist.remove j prβv() ; 1 } LocalMediaManager: :-LocalMediaManager() List_of_pitβr(LocalMedia) clist(client_list ) ; LocalMedia "obj; clist.reset ; while (clist.next(obj)) { if (obj){ delete obj; clist.remove_prev() ; } } 250/1 ///////////////// VisuallaterfacβManager Methods Visuallnt β rf aeβManager : : -Vlsuallnterf acβManager ( ) if (client) delete client; ) void Visuallntβrf acβManager: :proeeaa (MaConnection pconn) if ( (client - new Vlsuallnterf ace (Ctrl, pconn) ) — - HULL) { cout « "Fatal Maα. Allocation Error " « FILE « " " « " LIME__" « endl; return; ) client->proce3s asg() ; ) void VisualIntarfaeeManager: :MeetlngInvite (int seqjno, int rooa id, int sαβting_id, "" int participant, MediaBridgeDescLists aed, List_of_p (PartMedi iPridgeDescList) s part α Strings part_naae) "" { OQ_VΣMeetingΣnvite "a; a - new OQ_VΣMβetingInvitβ (seq ιo, 0, NULL, client) ; if ( !a) return; m->act ion (roomjd, aβeting_id, participant, part_naaβ, aed, partjned) , delete a "* "" J void VisuallntβrfaceManager::AddedParticipant(char status, int real_rooa_ld, int real_aβetiag_id, int vi_rooa_i int participant, MediaBridgeDescLists aed) ~ { OB_EveV AddedParticipant *a; m - new OBJEveVΣAddedPartieipant (0, 0, NULL, client) ; if Cm) return; m->action(status, rβal_room_id, real_meβting_id, vi_room_id, participant, med) ; delete a; ) void VisualInterfaeeMaaager::DroppedPartieipant(ehar status, int vi_rooa_id, int participant) i OEJBveVXDsoppedParticipant *a; m - new Oβ j EvβVIDroppedParticipan (0, 0, NULL, client); if (!a) return; a->action(status, vi_rooa_id, participant); delete a; . void VisuallntβrfacβManager::MββtingDestroyed(char status, int vi_rooa_id) { OE_BvβVT_*eβtingDβstroyβd *a; a - new OE_EveVΣMβetingDβstroyed(0, 0, NULL, client ) ; if ( !m) re urn; m->action (status, vi_room_id) ; delete m; void VisuallnterfaeeManager::MeetingSu»pendβd(char status, int vi_rooα_i d) OEJBveVXMβetlngSuspended *a; m - new OE_BveVXMeetingSuβpended(0, 0, NULL, client); if (!a) return; a->action(statua, vi_rooa_id) ; delete a; ~ } void VisuallnterfaeeManager::MeetingResumed(char statua, int vi rooα id) { OE_EveVXMeetingResuaed *a; a - new OE_EveVXMeetingResuaed(0, 0, NULL, client); if (!a) retur ; m->action(status, vi_rooa_id) ; delete a; ~ } void VisuallnterfaeeManager::MββtingLβft(char status, int vi_rooa_id, int participant, MediaBridgeDescLists med) { OEJSvβVILβftMββting *a; m - new OE_EveV LeftMeeting(0, 0, NULL, client); if (!m) return; m->aetion(status, vi_room_id, participant, med); delete m; } void VisuallnterfaeeManager: :JoinMβeting(int vi_room_id, int participant) i OE_EvβVΣJoinMββting "a; m - new OE__EveVTJoinMeeting(0, 0, NULL, client); if (!m) return; a->action(vi_room_id, participant) ; delete m; ) void VisuallnterfaeeManager: :MββtingReentered(char status, int vi_room_id, int participant, MediaBridgeDescLists med) I OE_EveVΣRβenterMeeting *a; m - new OE_EveVXReenterMeeting(0, 0, NULL, client) ; if (!a) return; a->action(status, vi_rooa_id, participant, aed); delete a; ) void visuallnterfaeeManager: :ServerAdded(char status, int vi_room_i , MediaBridgeDescs med) { OE_EveVIServerAdded *a; m - new OE_EveVISβrverAdded(0, 0, NULL, client); if (!a) return; m->action(status, vi_room_id, med) ; delete m; 1 void VisuallnterfaeeManager: :ServerDropped(char status, int vi_rooa_id. MediaBridgeDescs aed) OEJBvβVIServerDropped "a; a - new OE_EveyiServerDropped(0, 0, NULL, client); if (!a) return; a->aetion(status, vi_rooα_id, aed); delete a; ~ ) void VisuallnterfaeeManager::ListRooαβ(char "packet, int pkt_lβn) OE_EvβVTListRooαβ *a; - new OE_EveVXListRooαs(0, 0, NULL, client); if (!a) return; m->aetion(packet, pkt_lβn); delete a; ~ } void VisuallnterfaeeManager::ListMβetings(ehar "packet, int pkt len) OEJBveVTListMeβtings *m; a - new OE_EveVIListMeetings(0, 0, NULL, client) ; if (!a) return; m->ac ion(packet, pkt_lβn) ; delete a; > void VisuallnterfaeeManager::ShowMeetingStatus(ehar *packet, int pkt_len) ( OE_EvβVIShowMeetingStatus *a; m ■ new OE_Evβv ShowMeetingStatus(0, 0, NULL, client); if (!m) return; m->action(packet, pkt_len) ; delete m; } void VisuallnterfaeeManager::ShowMeetRoomStatus(ehar "packet, int pkt_len) { oεjεveVXShowMeetRoomStatus *m; m - new OE_EveVIShowMβetRoomStatus (0, 0, NULL, client) ; if ( !m) return; m->act ion (packet, pkt_lβn) ; delete m; } II 111111 II I II 1111 MRServerManager Methods MRServerManager: : MRServerManager (Controller "cont. String aachine, int port) : CosmObjMgr (cont) { MmConnection server; char host [HOST_NAME_LEN] ; is_alive - 0; server - N*->CallServer(aachine. ump(host), port ) ; server->NameTag<"CM") ; // hzmdle error here if ( sβrver->IsAssigned() — MmEnum: :MmFalse) { eout « "Cannot connect to ■ « aachine « " : : " « port « endl ; return; ) if ( ( ar_s β rver - new MRServer (cont, server) ) — ■ NULL) { cout « "Fatal Mβa. Allocation Error " « FILE « " " « LΣME_ « endl; return; . is_alivβ ■ 1; ) MRServerManager : : -MRServerManager ( ) { if (ar server) delete ar server; } void MRServerManager: process (MnConneetion serv) { if (mr_sβrver->connection ( ) — - serv) mr_servβr->proeess_msg() ; MnConneetion MRServerManager: : conn () { return (mr_servβr->conneetion ( ) ) ; } void MRServerManager: : CreateRoom (int seqjio, int attrib. Strings rooa naae) { OQ CreateRooα *m; - new OC_CrβatβRooa( seq_.no, 0, NULL, mr_sβrvβr) ; if ( !m) return; m->action (attrib, roomjiame) ; delete a; } void MRServerManager: :ListRooas(int seq_no) { OQ_ListRooas *m; m - new OQJListRooms(seqjio, 0, NULL, mr_servβr) ; if (!m) return; m->aetion() ; delete a; ) void MRServerManager::ListMeβtings(int seqjno) { OQ_ListMββtings *m; a - new OQ_ListMββtings(sβq_no, 0, NULL, mr_serv β r) ; if (!m) return; m->action() ; delete m; ) void MRServerManager::ShowMeetingStatus(int seqjio, int me β ting_id> { OQ_ShowMββtingStatus *m; m - new OQ ShowMeetingStatus(seqjio, 0, NULL, mr_server ) ; if {!a) return; a->aetion(aββting_id) ; delete a; ~ void MRServerManager: :ShowMeetRooaStatus(int seq_no, int aeeting id) OQ_ShowMββtRoo _Statua "a; a - new OQ_ShowMeetRooαStatus(seq_no, 0, NULL, ar server); if (!a) return; " ~ a->actio (aeeting_id) ; delete a; ~~ ) void MRServerManager: :CreatβMeeting(int seq_no, int rooa_id) OQ_CrβatβMβeting *a; a * new OQ_CreateMeeting(seqjio, 0, NULL, ar server); if (!a) return; ~ m->action(room_id) ; delete m; ) void MRServerManager::DestroyMeeting(int seg.no, int meeting id) { OQ_DestroyMeeting *m; m - new OQJDestroyMeeting(seqjio, 0, NULL, mr_server); if (!m) return; a->action(meetingjld) ; delete m; } void MRServerManager: :SuspβndMeβting(int seqjno, int meeting id) { OQ_SuspendMeeting *m; m - new OQ_SuspendMeeting(seq_no, 0, NULL, mr_server) ; if (!m) return; m->aetion(meβting_id) ; delete m; } void MRServerManager: :RβsumβMββting(int seqjio, int meeting_id ) { OQ_ResumβMeeting *a; m - new OQ_RβsuaβMeβting(seqjio, 0, NULL, mr_sβrv β r) ; if (!a) return; m->ac ion(aeeting_id) ; delete a; 1 void MRServerManager: :DestroyRooa(int seq_no, int rooa_id ) { OQ_DestroyRooa *m; a - new OQ_DβstroyRooa (seq_no, 0, NULL, mr_server) ; if ( !m) return; a->actio (room_id) ; delete m; } void MRServerManager: :AddServer(int seq_.no, int rooa_id. Media m. Strings udesc) OQjAddServer "msg; asg - new OQ_AddServβr(sβq_no, 0, NULL, mr_sβrver) ; if ( !asg) return; asg->action (room_id, a, udesc) ; delete asg; ~~ } void MRServerManager: :DropServβr (int seqjno, int rooa id. Media a. Strings udesc) OQ_DropServer "msg; asg - new OQ_DropServer (seq_no, 0, NULL, mr_server) ; if ( !asg) ret\xrn; "" msg->action(room_id, a, udesc) ; delete msg; ~ } void MRServerManager::ListServers(int seq_no, int room id) { OQ_ListServers "msg; msg * new OQ_ListSβrvers(seq_no, 0, NULL, mr_server) ; if (.msg) return; " ~ msg->action(room_id) ; delete msg; ~ " ) void MRServerManager: :GetPersonInfo(int seq.no, int part id) { OQ_GetPersonΣnfo *m; m ■ new OQ GetPersonΣnfo(seq.no, 0, NULL, mr_server); if (!m) return; m->action(part_id) ; delete m; } void MRServerManager: :AddParticipant(int seqjio, int mββting_id, int ρart_id) { OQ_AddParticipant *a; a « new OQ_AddParticipant(seqjno, 0, NULL, mr_server) ; if (!m) return; m->action(aeeting_id, part_id) ; delete a; 1 void MRServerManager: :DropParticipant(int seq.no, int aβeting_id, int part_id ) OQ_DropParticipant *m; a - new OQ DropParticipant(seqjio, 0, NULL, mr_server) ; if ( !m) return; m->action(mββting_id, part_id) ; delete m; 1 void MRSeirverManager: :LeaveMeeting(int seqjio, int meeting_id, MediaBridgeDescLists med) ( OQ LeaveMeeting *m; m - new OQ_Leav β Meβting(seg.no, 0, NULL, mr server); if (!a) return; ~ m->action(aeeting_id, aed) ; delete a; ~~ ) void MRServerManager::ReenterMeeting(int seq.no, int aββtlng_id, MediaBridgeDescLists aed) OQ_ReentβrMeβting "a; a - new OQ_R ββ ntβrMβeting(seqj.no, 0, NULL, ar_sβrvβr) ; if (!a) return; ~ m->action(aβeting_id, π_ed) ; delete a; ~ 1 Hill lllili EvβntNotifiβrManager Methods EventNotiflerManager::EventNotiflerManager(Controller *cont. String machine, int port) : CoαuObjMgr(cont) { MnConneetion server; char host[H0ST_NAME_LEN] ; is_alivβ ■ 0; server - NM- CallServβr(aachine.dump(host) , port); server->NaaaTag("CM") ; // handle error here if (sβrvβr->lsAssigned() —- MmEnum::MmFalse) { cout « "Cannot connect to ■ « machine « ": :" « port « end ; return; } if ((evβ_not - new EventNotifier(cont, server)) — NULL) { cout « "Fatal Mem. Allocation Error " « FILE « " " « LINE___ « endl; return; 1 EventNotiflerManager::-EventNotiflerManager() if (eve not) delete βve not; void EventNotiflerManager::process(MmConnection serv) if (eve_not->connβction() ■- » serv) eve_not- process_msg() ; MmConnection EvβntNotiflerManager: :conn() retur (eve_not->connection()) ; void EventNotifierManager: :send_start_msg () OE EveCMStart* s - new OE_EveCMStart(0, 0, NULL, eve iot ) ; sπ_^>action() ; delete sm; void EventNotiflerManager::multicast(List(int)s plist, OutgoingMessage "msg) OE_Ev β Multicast* eve - new OEJBveMulticast(0, 0, NULL, eve not); β vβ->action(plist, asg) ; " * delete eve; ) void Ev β ntNotifi β rManager::Me β tingInvite(int rooa_id, int aeeting id, MediaBridgeDescList* sod. List(int) t plist, List_of_p(PartMediaBridgeDescLlst)s pood) OE_Ev β M ββ tingInvit β * eve - new OE_EvβMββtingInvitβ(0, 0, NULL, eve->action(room_id, meeting_id, aed, pαed) ; multicast(plist, "" eve); - delete eve; } void EventNoti lerManager: :Aeeeptlnvitation (int rooa_id, int meeting id, M β diaBridg β D β scLists~med, List (int) s~plist) { OE_EvβAcceptInvitation* eve - new OE_EvβAccβptInvitation(0, 0, NULL, eve->action (rooa_id, meeting_id, med) ; multicast (plist, eve) ; ~ delete eve; ) void EventNotif lerManager : : Reject Invitation (int rooa_id, int meeting id, List(int) plist) OE_EveRejeetInvitation* eve - new oε_EveRejeetInvitation(0, 0, NULL, evβjnot); eve->action(room_id, mβeting_id) ; multicast(plist, eve); delete eve; } void EventNotiflerManager::AddβdParticipant (int roomjid, int meeting_id, int participant, MediaBridgeDescLists med, List(int)& plist ) OE EvβAddedParticipant* eve - new OE_EveAddedParticipant(0, 0, NULL, evβ_not) ; eve->action(room_id, meeting_id, participant, multicast(plist, eve); delete eve; } void EventNotifierManager::DroppedParticipant(int room_id, int meeting_id, int participant. List(int)s plist) OE EveDroppedParticipant* eve - new OE_EveDroρρβdPartieipant(0, 0, NULL, ~ "* eve_not) ; βve->action(room_id, meeting_id, participant); multicast(plist, eve) ; delete eve; . void εventNotifierManager: :MeetingLeft(int room_id, int meeting_id, int participant, MediaBridgeDescLists med, List ( ιnt ) fi plist ) OE EveLeftMeeting* eve - new OE_EveLeftMeeting(0, 0, NULL, — eve not) ; eve->aetion(room_id, mββting_id, participant, med); multicast (plist, eve) ; delete eve; } void EventNotifierManager: :MeetingRββntβred(int rooa id, int aββting_id, int participant, M β diaBridgβDββcList med, List(int)s plist) OE_Ev β R ββ nt β rMe β ting* eve - new OE_EvβReentβrMeβting(0, 0, NULL, βvβ_not) ; β ve->action(room_id, mβeting_id, participant, multicast(plist, eve) ; delete eve; ) void EventNotifierManager::MeetingDestroyed(int room_id, int aαeting_id, List(int) plist) ( OE_EveMββtingDestroyβd* eve - new OE_EveMeetingDestroyed(0, 0, NULL, evβ->aetion(room_id, aβeting_id) ; multicast (plist, eve) ; delete eve; } void EventNotifierManager: : JoinMeetingRejectedt int room_id. List (int) S plist) { OE_EveJoinMeetingRejected* eve - new OE_EveJoinMeetingRejected(0, 0, NUL eve->aetion(room_id) ; multicast(plist, eve); delete eve; } void EventNotifierManager: :RoomDestroyed(int roomjid, List(int)s plist) { OE_EveRoomDestroyed* eve - new OE_EveRoomDestroyed ( 0 , 0, NULL, evej ot) ; eve->action (room_id) ; multicas (plist, eve) ; delete eve; } void EventNotifierManager: :MeetingSuspended( int room_id, int meeting_id. List(int) plist) OE EveMeetingSuspended* eve - new OE_EveMeetingSuspended(0, 0, NULL, " ~ ~ evejiot) ; eve->action(room_id, meeting_id) ; multicast(plist, eve) ; delete eve; } void EventNotifierManager: :ServerAdded(int rooa_id, MediaBridgeDescs med. List(int)S plist ) OE_EveServerAdded* eve - new OE_EveServerAdded(0, 0, NULL, evej i ot ) ; eve->action(room_id, med) ; multicast(plist, eve); delete eve; } void EventNotifierManager: :ServerDropped(int room_id, MediaBridgeDescs med, Lis (int) plist ) { OE_EveS β rverDropp β d* eve - new OE_EvβServβrDroppβd(0, 0, NULL, eve no t) • βve->ac ion(room_id, med); _ «o -> . multicast(plist, eve) ; delete eve; 1 void EventNotifierManager: :MeetingResumed(int room_id, int aaeting id, " ~ List<int)s " plist) OE_Ev β M ββ tingR β sua β d* eve - new OE_EveMββtingRβsuaβd(0, 0, NULL, eve not) ; βvβ->action(room_id, mββting_id) ; "* multicast(plist, " eve); ~ delete eve; } void EventNotifierManager::JoinMeeting(int room_id, int meeting_id. List(int)S plist) { OE_EveJolnMeeting* eve - new OE_EveJoinMeeting(0, 0, NULL, βvβ not) ; eve->action(room_id, mβeting_id) ; "* multicast(plist, " ~eve) ; delete eve; ) ♦include <outgoing.h> ♦include <conn.h> ♦include <state.h> // OUTGOING REQUESTS void OutgoingRequest: :teaplatel(int id) < Conv->IntToBuf(RMgr->MySelf() , ( ( (char *)rep buf)+rep_len)) ; rep_len +- 4; Conv->IntToBu (RMgr->MySelf() , ( ( (char *)rep_buf)+rep_len) ) ; rep_len +■ 4; Conv->IntToBuf(id, ( ( (char *)repjouf)+rep_len) ) ; rep_len +— 4; rep_len - (len_in_CARD32 (rep_len) ) «2; set j -_sg_len (reρ_len) ; set_msg_data( (char *) repjouf) ; sendO ; } void OutgoingRequest::teaplate2(int id, int ρart_id) Conv->IntToBuf(RMgr->MySβlf0 , ( ((ehar *)rep_buf)+rep_len ) ) ; rep_len +- 4; Conv->IntToBuf(RMgr->MySelf{), (((char *)repjauf)+rep_len) ); rep_len +- 4; Conv->IntToBuf(id, ( ((char *)repjouf)+rep_len)) ; rep_len +- 4; Conv->IntToBuf(part_id, ({(char *)rep_buf)+rep_len)) ; rep_len +■ 4; rep_len - (len_in_CARD32 (rep_len) ) «2; set_msg_len (rep_len) ; set j nsg_data ( (char *) repjouf ) ; sendO ; void OutgoingRequest: :teaplat β 3 ( int room_id. Media m. Strings udesc ) ) ) ; repjoufIrβp_lβn++] - (char)m; )); l d l Conv->IntToBuf ( 0, ( ((char *)rep_buf)+rβp_lβn) ) ; // no parts rep_len - (len_in_CARD32(rβp_len) )«2; sβtjnsg_lβn(rep_lβn) ; "" setjnsgjiata( (char *)rep_buf) ; send() ; ~~ } void OutgoingRequest: : emplate4(int room_id, MediaBridgeDescLists med) { List_of_ρiter(MediaBrldgeDesc) mlist(med.media_list()) ; MediaBrldgeDesc* mdesc; ~ Conv->ΣntToBuf(RMgr->MySelf(), ( ( (char *)rep_buf)+rβp_len)) ; ) ) ; Conv->lntToBuf(med.length(), ( ( (char *)repjbuf)+rep_len)); wh le (ml st.next(mdesc) ) { rep_buf[rep_len++] - (char)mdesc->m; Conv->IntToBuf(adesc->udesc.length() , ( ( (char *)repjauf)+rep_len) ) ; rep_len +- 4; strcpy( (((char *)repjauf)+rep_len> , mdesc->udesc> ; rep_len +- mdesc->udesc.length() ; ) rep_len - (lβn_in_CARD32(rep_len) )«2; set_msg_len(rep_len) ; set_msg_data((ehar *)rep_buf) ; send() ; } void OutgoingRequest: :teaplateSO Conv->IntToBuf(RMgr->MySelf() , ( ( (char *)repjouf)+rep_len ) ) ; rep_len +- 4; Conv->IntToBuf(RMgr->MySelf0, (((char *)rep_buf)+rep_len ) ) ; rep_len +- 4; rep_len - ( len_in_CARD32 ( rep_len) ) «2 ; set_msg_len(rep_len) ; set_msg_data ( (char *) rep_buf ) ; sendO ; // OUTGOING EVENTS void OutgoingBvent: : teaplatel (int roomjid, int sαβting_id, int participant) ♦ifdef DEBUG cout « "OutgoingBvent Teaplatel : Rooa: • « rooa id « " Meet : " « m ββ ting_id « ■ Part? • « participant « endl; ♦endif ) , rβp_len - ( lβn_in_CARD32 ( rβp_len ) ) «2 ; sβtjnsg_lβn (rep_lβn) ; ~~ set_asg_data ( (char *) rep suf ) ; void OutgoingEvent : :tβmplatβ2 (int room_id, int meeting_id) i Conv->IntToBuf (RMgr->MySelf ( ) , ( ( (char *) rep_buf ) +rβp_lβn) ) ; rep_len - (len_in_CARD32(rep_len) )«2; sβt_msg_lβn(rβp_len) ; set "" msg_data( (char *)rep buf) ; } void OutgoingEvent: :template3(char status, int vi_room_id) { repjbuf [rep_len++] ■ status; Conv->IntToBuf (vi_room_id, ( ( (char * ) repjouf) +rep_len) ) ; rep_len +- 4; rep_len - (len_in_CARD32(rep_len) )«2; set_msg_len(reρ_len) ; setjnsg data( (char *)rep_buf) ; send() ; ) void OutgoingEvent::template4(char status, int vi_room_id, int participant) rβpjauf[rep_len++] - status; Conv->IntToBuf(vi_room_id, ( ( (char *)reρ_buf)+reρ_len ) ) ; rep_len +- 4; Conv->IntToBuf (participant, ( ( (char * ) repjauf ) +rep_len ) ) ; rep_len +- 4; rep__len - (len_in_CARD32 (rep_len) ) «2 ; set_msg_len <rep_len) ; set_msg_data ( (char *) rep_buf ) ; send O ; } void OutgoingEvent : : emplates (int room_id rβp len) ) ; ~ ) ) ; rep_lβn - <lβn_in_CARD32(rep_len) )«2; set_msg_len(rep_len) ; sβtjnsg_data((char *)rβpjbuf); void OutgoingBvent: :template6(int room_id, int aaeting id, int participant, MediaBridgeDescLists med) List_of_piter(MediaBrldgeDesc) mlist(mβd.mβdia_list() ) ; MediaBrldgeDesc* mdesc; ~ Conv->IntTθBuf(RMgr->MySelf(), { ( (char *)repjou )+rβp_len)) ; Conv->ΣntToBuf(aed.length() , (((char *)rβp_buf)+rβp_lβn) ) ; rep_len +- 4; "" mlist.reset() ; while (mlist.next(mdesc) ) ( rep suf[rβp_lβn++] ■ (char)mdβse->a; Conv->IntToBuf<mdesc->udesc.length() , (((char *)rep_buf)+rβp_len) ) ; rep_len +- 4; strcpy( ( ( (char *)repjsuf)+rep_len) , mdesc->udesc) ; rep len +- mdesc->udesc.length(); 1 rep_len - (len_in_CARD32 (rep_len) )«2; set_msg_len (rep_len) ; set _msg_data ( (char *) repjbuf ) ; void OutgoingMessage : : coπn_te___platel ( int vi_room_id, "" int participant, " MediaBridgeDescLists med) { List _of _piter (MediaBrldgeDesc) mlist <med.media_list ( ) ) ; MediaBrldgeDesc* mdesc; Conv-> IntToBu (vi_rooa_id, ( ( (char *) rep_buf ) +rep_len ) ) ; rep_len +" 4; Conv->IntToBuf (participant, ( ( (char *) repjbuf) +rep_len) ) ; rep_len +- 4; Conv-> IntToBuf (med. length ( ) , ( ( (char * ) rep_buf ) +reρ_len ) ) rep_len +- 4; mlist . reset ( ) ; while (mlist . next (mdesc) ) I rep_buf [rep_len++] - (char)mdesc->m; // may have~to send udesc : LATER?? } rep_len - ( len_in_CARD32 ( rep_len) ) «2 ; set_msg_len ( rep_len) ; set j nsg_data ( (char *) repjbuf ) ; send ( ) ; /old OutgoingBvent: : template 7 (int rooa id. String* aac h ine, in t port ) ( Conv->IntToBuf (rooα Ld, repjouf +rep_lβn) ; ; rep_lβn - (len_in_CARD32 (rβp_lβn) ) «2; sβt_msg_lβn(rβp_lβn) ; " " set_msg~data ( (char *) reρ_buf ) ; send ( ) ; ) void OutgoingEvent: : templates (char "packet, int pkt len) ( ~ rβp_len - (len_in_CARD32 (pkt_len) ) «2; set_Bsg_lβn (rep_len) ; set_msg_data (packet) ; send ( ) ; } void OutgoingEvent::template9(int room_id, MediaBridgeDescs mdesc) Conv->lntToBuf(room_id, rβp suf+rβp_lβn) ; rep_len - (len_in_CARD32(rep_len) )«2; set_msg_len(rep__len) ; set_msg_data((char *)repjbuf); ) void OutgoingEvent::tββplatβl0(char status, int vi_room_id, MediaBridgeDescs mdesc) repjouf [rep_len++] - status; Conv->IntToBuf (vi_room_id, reρ_buf +rep_len) ; rep_len +- 4; repjbuf[rep_len++] - (char)mdesc.m; Conv->IntToBuf(adesc.udesc.length<) , ( ( (char *) rep_buf)+rep_len) ) ; rep_len +- 4; strcpy(( ((char *) repjbuf)+rep_len) , mdesc.udesc) ; rep_len +- mdesc.udesc.length() ; r β p_l β n - ( l β n_in_CARD32 (rβp_lβn) ) «2; 3βt_mβg_lβn (rβp_lβn) ; ββtjsβg data ( (char *) repjouf) ; sendO ; "" . // OUTGOING REQUESTS from CM to MR rβp_lβn - (lβn_in_CARD32(rep_len) )«2; sβt_msg_lβn(rep_lβn) ; sβt_asg_data( (char *)repjbuf) ; send() ; ~ } void OQ CrβatβMββting: :action(int rooa id) { Conv->lntToBuf(RMgr->MySβlf(), (((char *)repjbuf)+rβp_lβn)); rep_len +— 4; Conv->ΣntToBuf(RMgr->MySelf() , ({ (char *)rβp_buf)+rβp_lβn)); (((char *)repjbuf)+rep_lβn)); // No attribs for now rep_lβn - <lβn_in_CARD32(rep_len) )«2; set_asg_len(rep_lβn) ; set_asg~data( (char *)rep_buf); sendO ; void OQ_ListRooms::action() templates() ; void OQ_ListMeetings::action() template5() ; void OQ_ShowMβetingStatus::action(int meeting_id) teaplatel(meeting_id) ; void OQ_ShowMββtRoomStatus: :action(int meeting_id ) teaplatel(aeeting_id) ; void OQ_DestroyRoom::action(int room_id ) teaplatel (room id) ; } void O Q _D β stroyHe β ting: :action(int aeβting_id) teaplatel (aeeting id) ; } void O Q _AddS β rv β r: :action ( int rooa_id. Media a. Strings udesc) teaplate3 (rooa id, a, udesc) ; ) void O Q _DropS β rver: :aetion (int rooa_id. Media a. Strings udesc) tβmplatβ3 (room id, a, udesc) ; ) void OQ_ListServers::action(int rooa id) I Conv->IntToBu ( RMgr->MySelf<) , ( ( (char *)rep buf)+rep len) ) ; rβp_lβn ■ (len_in_CARD32(rep_len) )«2; setjssg_len(rep len); ~ set_asg~data((char *)rβp_bu ) ; sendO; ~ void OQ_LβavβMββting::action(int meeting_id, MediaBridgeDescLists med) // tβaplate4(mββ ing_id, med); tβmplatβ2(meeting Ld, RMgr->MySelf()) ; void OQ_RββntβrMββting::actio (int meeting_id, MediaBridgeDescLists aed) / / teaplate4 (meeting_id, med) ; template2 (meeting_id, RMgr->MySelf 0 ) ; void OQ_SuspendMββ ing: : ac ion (int meeting_id) teaplatel (aeeting_id) ; void OQ_ResumeMeeting: :action(int meeting_id) teaplatel (aeβting_id) ; void OQ_GβtPβrsonlnf o : : action (int part_id) Conv->ΣntToBuf (part_id, ( ( (char *) rep suf ) +rep_lβn) ) ; rep_len +- 4; rep_len - (len_in_CARD32 (rep_len) ) «2; set _msg_len (rβp_len) ; set_msg~data ( (char *) repjouf ) ; sendO ; } void OQ AddParticipant: :action(int meeting_id, int part_id) { ( ((char *)repjouf)+rβp len) ) ; repjlen +- 4; " * MediaBridgeDescLists medlist - pn_dese->MediaList() ; Conv->∑ntToBuf(medlist.length(), < ((char *)repjouf)+rβp_lβn) ) ; rep_len +■ 4; Li β t_of_pit β r ( MediaBrldgeDesc) tlist(aβdlist.madia list ); tlist.reset(); ~ while (tlist.next(adesc)) ( +rep_lβn)); >udβsc) ; rβp_lβn - (len_in_CARD32 (rep_len) )«2; sβt_asg_lβn(rep_lβn) ; "* set nsg ata ( (char *) repjouf) ; void OE_EvβAddβdParticipant: : action (int rooa_id, int aeeting_id, ~ " int participant, MediaBridgeDescLists aed) ~ List_of_piter(MediaBrldgeDesc) mlist(med.media_list() ) ; MβdiaBridgeDβsc" mdesc; ~ Conv->IntToBuf(RMgr->MySβlf() , (( (char *)repjbuf)+rβρ_lβn) ; Conv->IntToBuf(med.lβngthO , (((char *)repjouf)+rep_len)); rep_len +- 4; mlist.reset() ; while (mlist.next(mdesc) ) { repjouf[rβp_lβn++] - (char)adesc->m; Conv->IntToBuf(mdesc->udesc.length() , (((char *)repjouf)+rep_len)) ; rep_len +- 4; strcpy((((char *)repjouf)+rep_len) , mdesc->udesc) ; rep_len +" adesc->udesc.length(); Conv->IntToBuf(adesc->machine.length() , (( (char *)repjouf)+rep_len) ) ; rep len +■ 4; strcpy((( (char *) rep_buf)+rep_len) , mdese- machinei ; rep len +~ mdesc->machine.length(); Conv->IntToBuf(»c_ese->port, ( ( (char *)repjouf)+reρ_len ) ) ; rep_len +" 4; } rep_len - (len_in_CARD32(rep_len) )«2; set_asg_len(rep_len) ; setjnsg_data((char *)repjbuf) ; } void OE EveAcceptInvitation::action(int room_id, int meeting_id, ° - MediaBridgeDescLists med) I List_of_ρiter(MediaBrldgeDesc) mlist(π_ed.media_list () ) ; MediaBrldgeDesc* mdesc; tβαplate2 (aββting_id, part_id) ; void OQ_DropParticipant::action(Int aeβting_id, int part_id) tβαplate2(aeeting id, part id) ; J // OUTGOING EVENTS froa CM to EN and VI void OE_EvβCMStart: :action() { Conv->ΣntToBuf(RMgr->MySβlf() , ( ((char *)rβpjβuf)+rβp len) ) ; rep_len +» 4; ~" ~ rβp_lβn - (lβn_in_CARD32(rβp_lβn>>«2; set_asg_len(rep_len) ; setjnsg_data((char *)repjouf); send ; ~ " } void OE_EvβMββtingInvite: :action(int room_id, int mββting_id, MediaBridgeDescLists med, " List_of_p(PartMediaBridgeDeseLlst)s paed) { Listj_f_pitβr(MediaBrldgeDesc) mlist(med.media_list() ) ; MediaBrldgeDesc* mdesc; PartMediaBridgeDeseLlst* pmdesc; Conv->IntToBuf(RMgr->MySelf0 , ( ( (char *)rβp_buf)+rβp_lβn)) ; rep_len +- 4; "* Conv->IntToBuf(RMgr->Control()->MyNamβ() .length() , (( (char *)repjouf)+rep_lβn) ); rep_len +- 4; strcpy(repjouf+rep_lβn, RMgr->Control()->MyName() ) ; rβp_lβn +- RMgr->Control()→MyNaaβ() .length() ; Conv->IntToBuf(room_id, ( ((ehar *)repjouf)+rep_lβn) ) ; rep_len +- 4; Conv->IntToBuf(meβting_id, (((char *)repjouf)+rep_len)) ; rep_len +» 4; Conv->IntToBuf(med.length(), (((char *)repjouf)+rep_len)); rep_len +— 4; mlist.reset() ; while (mlist.next(adesc)) { repjouf[rep_lβn++] - (char)mdesc->m; Conv->IntToBuf(adβsc->udesc.length() , (((char *)repjouf)+rep_len)) ; *)repjouf)+rep_len) , mdesc->udesc ) ; . sc->udesc.length() ; ♦ifdef DEBUG cout « "Requesting: Med: " « (int)mdesc->m « " Udesc: " « mdesc->udesc « endl; ♦endif } ' Conv->IntToBuf(pmed.lengthO, (((char *)repjouf)+rep_len ) ) ; rep_len +- 4; pmed.reset0 ; while (pmed.next(pmdesc)) { Conv->IntToBu (pmdesc->Participant0 , Conv->IntToBuf ( RMgr->MySβl () , (((char *)rβp_buf)+rβp len)) ; )) ; rep_lβn - (len_in_CARD32(rep_lβn))«2; set_msg_len(rep_lβn); "" sβt_msg_da a( (char *)rβp_buf) ; ) void OE_EveRejectInvitation::action(int room_id, int meetingjld) { template2(room_id, meeting id); ) void OQ_VMeetingInvitβ::action(int room_id, int mββting_id, int participant. Strings part_namβ, MediaBridgeDescLists med, List_of_p(PartMediaBridgeDeseLlst)s peed) { List_of piter(MediaBrldgeDesc) mlist(med.medla_list()) ; MediaBrldgeDesc* mdesc; PartMediaBridgeDeseLlst* pmdesc; Conv->IntToBuf(room_id, (((ehar *)rep_buf)+rep_len)); rep_len +■ 4; Conv->IntToBuf(meeting_id, (((char *)repjbuf)+reρ_len)) ; (participant, ( ( (char *)repjouf)+rep_len)) ; Conv-> IntToBuf (part aaβ . length ( ) , ( ( (char * ) repjouf) +rep_len> ) ; rep_len +- 4; strcpy { ( ( (char *) repjouf) +rep_len) , part jiame) ; rep_len +- part jiaaβ. length () ; ♦ifdef DEBUG cout « "OQJVIMeβt inglnvite : " « part_name « endl; ♦endif Conv->IntToBuf(med.length() , ( ( (char *)repjbuf)+rep_len)) ; rep_len +• 4; mlist.reset() ; while (mlist.next(mdesc)) { repjbuf[reρ_len++] - (char)mdesc->m; ♦ifdef DEBUG ~ cout « "VIMeetInvite: Media: " « (int)mdesc->ra « endl ; ♦endif // may have to send udesc : LATER?? } Conv->IntToBuf(pmed.length{) , ( ( (char *)rep_buf)+rep_len ) ) ; rep_len +« 4; pαed. reset O ; while (pαed.next (padeβe) ) ( Conv->IntToBuf (padβsc->Participant ( ) , ( ( (char *) repjbuf) +rep len) ) ; repjlen +— " 4; ~ M β dϊaBridgeDeacLists mβdlist - pβdβac→MediaLiβtO ; Co β v->lntToBuf ( m β dlist.length(), (((char *)rep buf)+rβp len ) ) ; repjlen +• 4; "~ ~ Li β t_of_pit β r ( M β diaBridgtf ) esc) tlist(ααdlist.media liatO); tlist.reset(); while (tlist.next(adesc)) { rep_buffrβp_lβn++] - (char)mdβsc- m; // may have to send udesc : LATER?? /* ) ) ; rβp_lβn - ( len_in_CARD32 ( rβp_len) ) «2 ; set_asg_len(rep_len) ; sβt_msg~data ( (ehar *) repjouf) ; sendO ; ~ } void OE EveRooaDestroyed: :action(int room_id) { tβmplatβ5(room_id) ; ) void oε EvβJoinMββtingRβjβctβd::action(int room_id) { templates(room id) ; ) void OE_EveDroppβdParticipant: :action(int room_id, int meeting_id, int participant) { teaplatel (room_id, meeting_id, participant) ; } void OE EveVIDroppedParticipant::action(char status, int vi_room_id, "~ int participan ( teaplate4(status, vi_room_id, participant) ; } void OE_EveLeftMββting::action(int room_id, int meeting_id, int participant, MediaBridgeDescLists med ) { // template6(room_id, mβeting_id, participant, med); teaplatel(room_id, mβeting~id, participant); } void OE EveReenterMeeting::action(int room_id, int meeting_id, int participant, MediaBridgeDescLists med) // template6(room_id, meeting_id, participant, med ) ; teaplatel(room_id, meetingjld, participant); ) void OE EveMeetingSuspended::action(int room_id, int meeting_id ) teaplate2 (rooα_id, meeting_id) ; voi d OE _ E veV M ββ tingSuapend β d: : action (ehar statua, int vi_room id) tβaplate3 (status, vi rooa id) ; } void OE_Ev β M β etingR β auα β d: :aetion (int rooa_id, int aβeting_id) teaplate2 (rooa_id, aβeting_id) ; ■raid OE_EvβJoinMββting: :action (int rooa id, int aaeting id) { templatβ2 (room id, mββting_id) ; ) void OE_EveServerAdded: : action (int rooa_id, MediaBridgeDescs aed) template 9 (rooa id, aed) ; ) void OE_EveServerDropped: :action(int rooa id, MediaBridgeDescs sod) ( template9(room_id, med) ; } void OE_EveV ServerAdded: :action(char status, int vi_rooa_id, MediaBridgeDescs aed) i teaplatel0(status, vi rooa_id, aed) ; ) void OE_EvβV ServerDropped::action(char status, int vi rooa_id, MediaBridgeDescs aed) { teaplatβlO(status, vi_room id, med) ; > void OE_EveVIMββtIngResumed: :action(char status, int vi_rooa_id) { teaplate3(status, vi_rooa_id) ; ) void OE EveVILeftMβeting: :action(char status, int vi_rooa_id, int participant, MediaBridgeDescLists { template4(status, vi_room_id, participant) ; } void OE EveVIRβentβrMββting::action(ehar status, int vi_room_id, ~ int participant, MediaBridgeDescLists { template4(status, vi_rooa_id, participant); } void OE EveMeetingDestroyed::action(int room_id, int aeβting_id) { templete2(room_id, aβeting_id) ; } void OE_EveVIMeβtingDestroyed: :action(char status, int vi_rooa_id ) { template3(status, vi_room_id) ; void OEJBv β IΛddedPart icipant : : action (char status, int real room id, int rβalj_αβting_id, int vi_rooa id7 " ~ int participant ,~MβdiaBridgej>βacLiat* aad) repjbuf I rep_lβn++] - statua; ); void OE_EveVΣJoinMβ β ting::action(int vi_room_id, int participant) Conv->lntToBuf(vi_rooa_id, ( ( (char *)repjouf)+rβp_lβn)) ; ) ) ; rβp_lβn - (len_in_CARD32(rβp_len) )«2; setjssg_lβn(rep_len) ; sβt_msg_data( (ehar *)repjouf) ; send(); } void OE_EveMultieast: :action(List(int)s plist, OutgoingMessage *asg) < int p; // event len Conv->IntToBuf( (msg- asg_hβader_lβn() + msg->msg_len()), (( (char *)repjouf)+rep_len)); // list length Conv->lntToBuf (plist . length () , ( ( (char *) repjbuf) +rβp_len) ) ; plist . reset ( ) ; while (plist .next (p) ) ( Conv->ΣntToBuf (p, ( ( (char *) repjbuf) +rep_len) ) ; rep len +- 4; } bcopy (msg->msg_hβadβr ( ) , ( ( ( char * ) rep_buf ) +rep_len) , ~ msg~>asg_header_len ( ) ) ; rep_len +- asg->msg_hβader_len ( ) ; bcopy (asg->mβg_dataT) , ( ( (char *) rep_buf ) +rep_len> , msg-> β sg_l β n () ) ; rep_len +- aβg->msg_len() ; rep_len - ( lβn_in_CARD32 ( rβp_len ) ) «2 ; set j nsg_lβn (rβp_len) ; set_msg~data ( (char *) repjouf) ; send ; 1 void O EJ S veVIListRooms: : act ion (char *packet, int len ) { teaplateβ (packet, len) ; 1 void OEJSveVIListMeetings::action(char "packet, int len ) { templates(packet, len); • d OE_Bv β VIShoi-Me β tingStatus : : action (char *packet, int len ) t β aplatββ (packet, len) ; void OE_Bv β VIShowM β etRooαStatus : : act ion (char -packet, int len ) templates (packet, len) ; > // Events to Local Media Managers void OE_EveConn β etToBridg β ::action ( lnt room_id. Strings aachine, int port ) template7(room_id, machine, port) ; void OE_EveDiseonn β ctFromBridg β ::action(int room_id. Strings machine, int port ) teaplatβ7(room_id, machine, port); ♦include <controller.h> ♦include <proto.h> Protocol: :Protocol(Controller *ctrl) ( Ctrl - Ctrl; Conv - Ctrl->Conv(); for (int i - 0; i < MAXJMSG TYPES; i++) { for (int j - 0; j <~MAX MSGS; j++) { switch (i) < ~ case ERROR_MR_SERVER: case ERROR_REGISTRY_SERVER: case ERRORJMAN: case ERROR_CM: case ERRORJVI: Gβn_fune_tab[i] [j] - GenJErrMsg; break; default: Gen_func_tab [i] [j] - default_generator; break; } } } Gen_func_tab [REPLY_I»_SERVER] [MR_CREATE_ROOM] - Gβn_IR_CrβateRoom; Gen_func~tab[REPLY_MR SERVER] [MR CREATE_MEETΣNG] - Gen_ΣR_CreateMee ing; Gen_func_tab[REPLY_MR. "" SERVER] [MR. "* ADD_SERVER] - Gen IR AddServer; Gen_func_tab[REPLY_MR~SERVER] [MRJDROP_SERVER] - Gβή_IR_DropServer; Gen_func_tab [REPLY MR_SERVER] [MR_ADD_PARTICIPANT] - Gβή IR_AddPartieipant ; Gen_func_tab [REPLY_MR_SERVER] [MR_DROP_PARTICIPANT] - Gβn_IR_DropParticipant; Gen_func_tab [RE?LY_MR_SB lVER] [MR_SUSPEND_MEETΣNG] - Gen_ΣR_SusρendMeβting; Gen_func_tab [REPLY_MR_SERVER] [MR_REENTER_MEETΣNG] - Gen_IR_ReenterMβeting; Gen_func_tab [REPLY MR_SERVER] [MR_RESUME_MEETΣNG] - Gen_IR_RβsumeMeeting; Gen_func_tab [REPLY_MR_SERVER] [MR_LIST_ROC»ϊS] - Gen_ΣR_ListRooms ; Gen_f unc_tab [REPLY_MR._SER.VER] [MR_LIST_MEETINGS] - Gen_IR_ListMeetings; Gen_func_tab[REPLY_MR_SERVER] [MR_LIST~SERVERS] - Gen_IR_ListServers; Gen_f unc_tab [REPLY_MR_SERVBR] [MR_SHOW~MEETING_STATUS] - Gen_IR_ShowMeetingStatus ; Gen_func_tab [REPLY_MR_SERVER] [MR_SHOW MEETROOM_STATUS] - Gen_IR_ShowMeetRoomStatus ; Gen func tab [REPLY_MR_SERVER] [MR_DESTROY_MEETING] - Gen_IR_DestroyMeeting; Gen_fune_tab tREPLY_MR_SERVER] [MR_DESTROY_ROOM] - Gen IR DestroyRoαm; G β n_func_tab ( REPLY_REGISTRY_SERVER ] tREG_GET_PERSOM IOTOT - Gen IR GβtPβrsonlnfo; Gβn_f une_tab m_B?LX_VΣ VΣ_MEETING_INVITATION] - Gen IR VIMββtingΣnvitation; Gβn_f unc_tab f EVU_rT_Vl EVE_CREATE_MEETING] - Gβn_IE~EveCrβatβMβeting; Gβn_f unc_tab CKWT rx EVE_CREATE_PERSXSTENT_MEXTISG3 - Gen IE EveCrβatePβrsistβn Gβn_ uncjtab {IVBRJVI EVE_VI_CREATE_MEET_IN_EROOM] - Gen IE BveVXCreatβMββtlnERo Gen_f unc " tab [BVBR VX ' EVE_VI_JOIN_MEETIHG] - Gen_ΣE_Bvevf oInMeeting; Gβn_f unc_tab [EVBfT_VT EVE_JOIH_MEETING_REJECTED] "" - Gen IE BvβV JoinMββtingRβjβct Gβn_f unc_tab [EVENT_VI EVE_VI_ADD_PARTΣCΣPANT] - Gen ΣE~EvβVIAddParticipant ; Gβn_f une_tab [EVENT_VI EVE_VT_DR0P_PΛRTICIPA1IT] - Gen ZX EveVIDropParticipant ; Gen_f une_tab [EVENT_VΣ EVE_VI_SUSPEND_MEETING] - Gβn_ΪE_EvβVISuβpβndMββting; Gβn_func~~tab (EVENT VI EVE_VX_RESUME_MEETING] - Gen IB Eve VΣResuπie Meeting; Gβn_f uncjtab f EVβra VI EVE_VI_REENTER_MEETING] - Geή IB EveVIRaenterMeeting; GβnjE unc_tab [EVENT_VΣ EVE_V1_LEAVE_MEETI»G] - Gβn_IE_EvβVILβaveMeβting; Gβn_f unc_tab [EVENT_VI EVE_VI_ADD_SERVER] - Gβn_IE_EveVIAddSβrvβr; Gβn_f ύnc_tab [EVENT_VI BVE_VI_DROP_SERVBR] - Gβn_UB EvβVIDropSβrvβr; Gen_f une_tab [EVENT TI BVE_VI_DESTROY_MEETING] - Geή IE BvβVIDβstroyMββting; Gβn_ unc_tab [EVENT_VI EVE_VΣ_LIST_ROOMS] - Gen IE EvβVΪListRooas; Gβn_ unc~tab tEVENT_VI EVE_VT_LIST_MEETINGS] - Gβn~IE_EvβVIListMβetings ; Gβn_f une~tab [EVENT_VΣ EVE_VI_SHOW_ASSOC_MEETIHG] - Gen IE EvβVIShowAssocRooa; Gen_ unc_tab [EVENT_VI EVE_VI_GET_PERSON_NAME] - Gen lEJBvβVIGβtPβrsonNaae ; Gβn_f unc_tab [EVENT_VΣ EVE_VT_GET_PERSON_ID] - Gen IBJEvβVIGβtPβrsonΣd; Gβn_f unc_tab [EVENTJvT EVE_VI_GET_PERSON_ΣD] - Gβn_IE_EvβVTGetPβrsonId; Gβn_f unc_tab [EVENT_VI EVE_VI_UP] « Gen_IE_EveVΣUp7 ~~ Gβn_f unc~tab [EVENT_VΣ EVE_VI_DOWN] - Gβn_IE_EvβVIDθwn; Gβn_f unc_tab [EVENT_VΣ EVE_VΣ_SHOW_MEETΣNG_STATUS] - Gen ΣEJBvβVΣShowMeetingStatu Gβn_f unc_tab [EVENT_VI EVE_VΣ_SHOW_MEETROOM_STAXUS] - Ge_n_IE_EveV ShowMeetRooaSta Gen_f une_tab [EVENT_CM: EVE_MEETΣNG_INVITE] - Gβn_IE EveMeet inglnvite; Gen~f une_tab [EVENT_CM: EVE ACCEPT INVITATION] - Gβn~IE EvβAccβptlnvitation; Gβn_f unc~tab (EVENTjCM: EVE~RBJECT_ΣNVITATIQN] - Gen ΣE_EvβRβjβctInvitation; Gβn_f unc_tab [EVENT_CM: EVE_SERVER_ADDED] - Gen_IE_EvβServβrAddβd; Gβn_f unc_tab [EVENT_CM: EVE_SERVER_DROPPED] * Gβn_IE_EvβSβrvβrDroppβd; Gen_f unc~tab [EVENTjCM, EVE_ROOM_DESTROYED] - Gen XEJBveRoeaDestroyed; Gen_f unc_tab [EVENT_CM: EVE_MEETING_DESTROYED] - Gβn_IE_EvβMββtingDβstroyed; Gen_f unc~tab [EVENT_CM EVE_ADDED_PARTΣCΣPANT] • Gen_IE_EvβAddedPart icipant ; Gen_f unc~tab [EVENTjCM: EVE_DROPPED_PARTICIPANT] - Gen_IE_EveDroppedParticipant ; Gen_f unc~tab [EVENT af EVE_ROOM_LOCKED] - Gen_IE_EvβRooaLoeked; Gen_f unc_tab [EVENT_CM: EVE_ROOM_UNLOCKED] - Gen_IE_EvβRooaDnloekβd; Gen_f unc~tab [EVENTjCM! EVE_LEFT_MEETΣNG] - Gen_IE_BveI_eftMeeting; Gen_f unc_tab [EVENTjCM. EVE_REENTER_MEETING] - Gen_IE_BveRβenterMee ix_g; Gen_f unc_tab [BVENT_CM: EVE_MEETING_SUSPENDED] - Gen_IE_EveMeetiJigSuspended; Gen_f unc~tab [EVENT_CM; EVE_MEETΣNG_RESUMED] - Gen_IE_EvβMββt ingResumed; Gen_f unc_tab [EVENT_CM; EVE_JOIN_MEETΣNG] - Gen_lE_EvβJoinMβeting; Gen func tab [EVENT C EVE JOΣN MEETING REJECTED]-- Gen IE_EveJoinMeetingRejected Gen_f unc_tab [EVEHTJtt [EVE_MAN_UP] » Gen_IE_EveLMUp; Gen f unc~tab [KVTOΪJJA [EVE_STATE_CHANGE] - Gen_IE_EveI_MStateChange; ) void Protocol::interpret iβadβr(char *header, CARD8S type, CARD8S opcode, CARD32S seq, CARD32S len) i int tap; type - header[MSG HOFFSET_TYPE] ; opcode - header[MSG_HOFFSET_CODE] ; if (type < 0 || type > MAX_MSG_TYPES ) type - 0; if (opcode < 0 I ! opcode > MAX_MSGS ) opcode - 0; seq - Conv->BufToInt(hβadβr+MSG_HOFFSET_SEQ) ; tap ~ Conv->BufToln (header+MSG_HOFFSET_LEN ) ; len - t«p«MSG_UNIT; 274 IncoaingMessage * Protocol::construct_asg(CARDβ type, CARDβ opcode, CARD32 seq, CARD32 len, char "data, Connection "conn) if ( type >- -MAX_MSG_TYPES I I opeode ■ MAX MSGS) { eout « "Illegal Type/Opcode: " «~(int)type « • - « (int)opcode « en type - REQUEST_GEN_SERVER; opcode - MAXJMSGS-1; retum ( G β n_fune_tab[ ( int ) type] [ ( int)opcode] (type, opcode, seq, ) int Protocol: :rβgisterjasgjproc(CARDβ type, CARDS opcode, IneoaingMesβagePtr (*msg_proc) (CARDβ type, CARDβ opcode, CARD32 seq, CARD32 len, ehar "data. Connection "conn)) if (type » MAX_MSG_TYPES I I opcode >- MAXJtSGS) return(-1); "* "* Gβn_fune_tab[ (int)type] [(int)opcode] - msg_proc; return(0) ; ♦define STATE_MACH_TEST ♦include <state.h> ♦Include <obj_man.h> int RoomFsm::tβrminate_action(InterObjectBufferS iob) { return(E€ action(iob)); ) int RoomFsm::El_action(InterOb ectBufferS iob) { next_msg_prepare(); reqjnedia • iob.eve_create_meeting.med; last_part_id - iob.eve_crβate_meβting.participant; scenario - (io .msg code — EVE CREATE MEETING) ? ~ ~TRANSIENT_MEETΣNG : PERSΣSTENT_MEETING; ♦ifdef STATE MACH TEST cout « "~ **»*****« LAST SEQ: " « lastjseq « endl; cout « "Rooa: " « vi_rooa_id « " " « real_rooa_id « " εi_action: " « endl; cout « -Send MR_CREATE_ROOM to MR: NS - " « reqjaedia.length() « " Scene: " « scenario « endl; ♦endif RMgr->Control()->MRMgr()->CreateRocα(last_seq, iob.eve createjneeting.a iob.βve_createjneetin .r return(SUCCESS) ; ) int RoomFsm: :E2_action(InterObjectBufferS iob) { nextjnsg oreparβ() ; lastjpart id - iob.eve createjneeting_in_erooa.participant; scenario - PERSISTENTJMEETINGT ♦ifdef STATE MACH TEST , _ ^ _ ... cout~« "~ ********* LAST SEQ: " « last_seq « endl; cout « "Room: " « vi_room_id « " " « real_room_id « " E2_action: " « endl cout « "Send MR_LIST_SERVERS to MR: NS - " « __ _ ,, r β q media.length() « - Scene: " « scenario « en dl ; ♦endif RMgr-X^trol () ->MRMgr () ->ListServers(last_sβq, real room id); return(SUCCESS); — ~ } int RooaFsa::E3 action(IntβrObjectBuffβrs iob) { List(int) plist; next_msg_prepare(); ♦ifdef STATE_MACH_TEST cout « " ********* _j_5 T SKQ . . < last sβq « βnd cout « "Rooa: " « vi_rooa_id « " " « real rooa_id « • E3_action: " « cout « "Send EVE_JOIN_MEETING to owner CM: " ■ « iob.eve vi join meeting.owner « endl; ♦endif "" plist.insβrtjiext(iob.evβ_vi_join meeting.owner); RMgr->Control()->ENMgr()- JoϊnMββting(rβal_rooa_id, iob.βve_vi_join_aβeting.mββt_id, plist); sβt_invitβ_tiaer(INVXTE_TIMEOUT) ; ~~ return(SUCCESS) ; } int RoomFsm::B4 action(InterObjectBufferS iob) [ nextjnsg reparβ(); rβal_room_id ■ iob.βvβjnβeting_invitβ.rooa_id; rβq aβdia - iob.βvβ_aβeting_invitβ.med; ~ pββr part_id ■ iob.eve_meeting_invite.participant; meeting - " new Meeting(iob.eve_aβeting_invitβ.meeting id, this, RMgr); if ("meeting) [ ~ cout « "Fatal Mem Alloc Error: " « FILE « (int) LΣNE__ « en } meetlng->add_participant(RMgr->MySelf() , reqjnedia) ; List_of_piter(PartMβdiaBridgeDescList) plist(iob.eve_aeβting_invite.partjned PartMediaBridgeDeseLlst *p; plist.reset(); while (plist . next (p) ) { ♦ifdef DEBUG cout « "Recvd. EvβMββtinglnvite : Part : " « p->P art icipant () « endl; ♦endif nιββ ing->add_participant (p->Part icipant 0 , p-«4ediaList 0 ) ; } ♦ifdef STATE_MACH TEST cout « " ********* LAST SEQ: " « last_seq « end cout « "Room: ■ « vi_room_id « " ■ « real_room_id « ". E4_action: " « cout « "Send REQ_VI_MEETING_ΣNVΣTATION to VI: NuaSβrvers: " « req j aedia.nua_ et_to_service() « endl; ♦endif RMgr->Cont rol ( ) ->VΣMgr ( ) ->MeetingInvite ( last_seq, real_room_id, mββting->Id() , peer_part_id, reqjnedia, iob . evejneeting_invite .partjned, iob.eve_meeting_invite.part_naae) ; return (SUCCESS) ; ) int RoomFsa: :E5_action (InterOb jectBuf ferfi iob) { nex j nsg orepare 0 ; r β al_roca_id ■ iob.Rβp_mr_creatβ_rooa.rooa_id; ♦ifdef STATE_MλC8_TEST cout « " ********* JASI SBQ . . < last a < βndl; eout « "Roo : • « vi_rooα_id « " • « real rooα_id « " E5 action: " « end eout « "Send MR_ADD_SERVER to MR: NuaServers : ■ « rβq j aedia.nuB_vβt to_sβrvi cout « "Yet to service: " « req_aβdia.nua_ vet to service () « endl; "* ♦endif ~" ~ MediaBrldgeDesc *b; if (reqjnedia.next_bridge to service(b) — SUCCESS) { ♦ifdef STATB_MACH_TEST " ~ ~ cout « "Media: " « (int)b->m « " Udesc: " « b->udββc « endl; ♦endif RMgr→Control()->MRMgr()->AddServer(last_sβq, real_room_id, ) retur (SUCCESS); } int RooaFsa::E6_action(InterObjectBufferS iob) { ♦ifdef STATE_MACH_TEST cout « " "" ********* _j_s T SEQ: - « iast_sβq « endl; cout « "Rooa: " « vi_rooa_id « " " « real_rooa_id « " E6/E33/E56/E37: " eout « "Send DestroyMeeting " « endl; ~ eout « "Terminating FSM—" « endl; ♦endif if (scenario — PERSISTENT_MEETING) { if (aeeting) { nβxt_msg_prβpare(); RMgr->Control()->MRMgr()->DestroyMaeting(last_seq, meeting->Id() RMgr->Control()->ENMgr()->MeβtingDβstroyed(rβal_room_id, »ting->Id() , meeting->PartListWithoutMe() ) ; ) else MediaBrldgeDesc *b; if (fulljaedia.nβxt_bridge_to_service(b) — SUCCESS) { nextjnsgjorβparβ() ; RMgr^x:ontrol()->MRMgr()->DropServβr(last_seq, real_room_id, b->m, b->udesc) ; RMgr->Control()->LMMgr()->DisconnβctFroaBridge( real room_id, b—>m, b—>udese, b->aachine, b->port); ) if (meeting) { next_asg_prβpare ; if (my rooa) { RMgr- Cont rol ( ) ->MRMgr ( ) ->Dβst royRooa ( last_seq, real_room_id ) ; RMgr-x:ontrol ( ) ->ENMgr ( ) ->RoomDβst royed (real_room_id, meeting->P art Li ) else { RMgr->Control{)->MRMgr()->DestroyMβeting(last_seq, meeting->Id()>; RMgr-x:ontrol()->ENMgr()->MββtingDestroyed(real_room_ιd meeting->Id(), meeting->PartListwithout ) ) RMgr->Control()->VXMgr()->MeetingDestroyed(l, vi_room__id ) ; // Actually we should have some state bef. terminate to wait // for the success reply of MR?? return (SUCCESS) ; J int RoomFsm::E68_aetion(InterObjeetBuffers iob) { ♦ifdef STATEJMACHJFEST cout « " ********* JAS, SBQ . • < lΛaz < βndl; cout « "Rooα: ■ « vi_rooa_id « ■ • « real rooa id « " E68: " " « endl; cout « "Send DeatroyRooa" « endl; "" ~ cout « "Tβrainating FSM..." « endl; ♦endif MediaBrldgeDesc *b; if ( fulljnedla.next_bridge_to_serviee(b) —- SUCCESS) { next_msg_prβpare()7 RMgr->Control()->MRMgr()->DropSβrver(last_seq, rβal_rooa_id, b—>m, b->udesc) ; RMgr->Control()->I_MMgr()->DisconnβctFroaBridge( r β al_rooa_id, b->m, b->udβsc, b- β-achine, b->port); nextJssg prepare() ; ListTint) plist; plist.insert_next(last_part_id) ; RMgr->Control()->MRMgr()->DβstroyRoom(last_seq, rβal_room_id) ; RMgr->Control()->ENMgr()->RoomDestroyed(real_room_id, plist) ; RMgr->Control()->VIMgr()->MeetingDestroyed(1, vi_room_id) ; return(SUCCESS) ; } int RooaFsa: :E7_action(InterObjeetBufferS iob) { nextjssgjprepare(); reqjnedia.update_prev_request(iob.Rep_mr_add_server.machine, iob.Rep_mr_add_server.port, MEDIA_SET) ; ♦ifdef STATE_MACH_TEST cout « " ********* __sτ SEQ: " « last_seq « endl; cout « "Room: " « vi_room_id « " " « real_room_id « " E60/E7_action: " « endl cout « "Send MAN_CONNECT_TO_BRIDGE: " « iob.Rep_mr_add_3erver.machine « " " « iob.Rβp_mr_add_server.port « endl; cout « "Send MR_ADD_SERVER to MR: NumServers: " « reqjnedia.num_yet_to_service() ♦endif RMgr->Control()->I_f_Mgr()->ConnectToBridge( real_rooa_id, reqjϋedia.LastMedla()->m, reqjnedia.LastMedla()->udese, reqjnedia.LastMedla()->aachine, reqjnedia.LastMedla()->port) ; MediaBrldgeDesc *b; if (reqjnedia.nβxt_bridgβ_to_service(b) — SUCCESS) [ , ♦ifdef STATE MACH_TEST ~ "" cout "" « "Media: " « (int)b->m « " Udesc: " « b->udesc « endl; ♦endif RMgr->Control()->MRMgr()->AddServer(last_seq, real_room_id, b-> } return(SUCCESS) ; ) int RoomFsm: :E8 action(InterObjectBufferS iob ) fulljnedla - req_aedia; meeting - new M ββ ting ( iob.R β ρjnr_create_mβeting.ι-αβting_id, this, RMgr) ; if ( 'meeting) { ^ cout « "Fatal Mea Alloc Error: ■ « FII_E_ « (int) LINE__ « en d l; a ββ ting->add_participant(RMgr->MySβlf(), req_Bodia); ♦ifdef STATE_MACH_TSST cout « " ********* ms, SEQ: " « last_sβq « en d l ; cout « "Rooa: " « vi_rooa_id « ■ ■ « real roαa i d « " M eet: ■ « ae β ting->id() « ■ E8 action: " << endl; cout « "MEETING IN PROGRESS ■ " ; ♦endif RMgr->Control () ->VIMgr()->AddedParticipant(1, real_rooa_id, aeeting->Id(), vi_rooa_id, last_part_id, reqjnedia) ; return(SUCCESS); ) int RoomFsm::E12_action(InterObjeetBufferS iob) { ♦ifdef STATE_MACH_TEST cout-« "Room: " « vi_rooβ_id « " ■ « real_rooa_id « " E12_action: " « endl; cout « "Send EVE_DROPPED_PARTICXPANT to VI" « iob.templatel.participant « endl; ♦endif RMgr->Control()->VΣMgr()->DroppβdParticipant(i, vi_rooa_id, iob.teaplatel.participant) ; RMgr->Control()->ENMgr()->DropρβdParticipant(rβal_roco_id, mββting->Id(), iob.tβsiplatβl.participant , mββting->PartListWithoutMβ()); return(SUCCESS) ; } int RoomFsm: :E1S action(InterObjectBuffers iob) { ♦ifdef STATE_MACH_TEST cout « " ********* j _si SEQ: " « last_seq « endl; cout « "Room: " « vi_room_id « ■ " « real_room_id « " E15_action: " « endl; cout « "Send MR SUSPEND MEETING to MR" « endl; ♦endif next jssgj repare ( ) ; RMgr->Control ( ) ->MRMgr ( ) ->SuspendMeeting ( last_seq, mββting->∑d ( ) ) retur (SUCCESS) ; } int RoomFsm: : El 6_action ( InterOb jectBuf fers iob) { ♦ifdef STATE_MACH_TEST cout « " ********* u_sτ SEQ: " « last_seq « endl; cout « "Room: " « vi_room_id « " ■ « real_room_id « " E16_action: " « endl ; cout « "Send EVE_MEETING_SUSPENDED fail to VΣ" « endl; ♦endif ~ RMgr->Control()->VIMgr()->MeetingSuspended(0, vi_rooa_id) ; return(SUCCESS) ; 1 int RoomFsm: :E17 action(InterObjectBu fers iob) 279 NOT FURNISHED UPON FILING { ♦ifdef STATE_MACH_TEST tt^ tt •» ■ ' _ « , , _ ********* L AST SE Q : " « last seq « endl; eout « "Rooα: " « vi_rooα_id « - - « real rooa id « " E17 action: - « en cout « -Send EVBJMEEΪΣHG SUSPENDED to peer CMs/VI"" « endl- ~ ♦endif ~" R M gr->Control ( ) ->VIMgr ( ) ->Me β tingSuspβndβd(l, vi rooα id) ; RMgr- Control () ->BM i gr () ->M ββ tingSuapended(r*al room Id, ae β ting->∑d () , meβting->PartListWithoutMβ ( ) ) ; return (SUCCESS) ; ) int RoomFsm::El9 action(InterObjectBufferS iob) { ♦ifdef STATE_MACH_TEST CO Ut « " ********* u^s, SEQ: . <κ last 3βq <<; endl; cout « "Room: • « vi_rooα_id « - • « rβal_rooa id « " El9 action: - « en cout « "Send EVE MEETING RESUMED to VI" « endl; "* ~ ♦endif ~ RMgr->Control0->VIMgr()->MeetingResumed(1, vl_rooa_id) ; return(SUCCESS); } int RoomFsm::E13 action(InterObjectBufferS iob) { return(E57 action(iob)); int RooaFsa::E14_action(InterObjectBuffers iob) I return(£34 action(iob)); ) int RoomFsm::E29_action(InterObjectBuffers iob) { ♦ifdef STATE_MACH_TEST cout « " ********* LAST SEQ: " « last_seq « endl; cout « "Room: " « vi_room_id « " " « real_room_id « " E29_action: " « en cout « "Send EVE_JOIN_MEETΣNG_REJECTED to V : * << endl; ♦endif // RMgr-x:ontrol()->VlMgr()->JoinMeetIngRejected(vi_room_id) ; return(SUCCESS); int RoomFsm::E33_action(InterObjectBufferS iob) return<E6_action(iob)); int R oomFsm: :E37_action(IntβrObjectBufferS iob) return(E6_action(iob)) ; int RoomFsm::E38_action(InterObjectBuffers iob) retur (E59_action(iob)) ; int RoomFsa::E39_action(InterObjectBufferS iob ) { ♦ifdef STATE_MACH_TEST 280/1 cout « •*••••••• _ j _5 T SEQ . . κ< la3t < βndl . cout « -Rooa: ■ « vi_rooa_id « - - « rβal_rooa id « " E39/E407E76: - « en cout « "Send EVE_VI_ADDED_PARTICIPANT failed" « endl; ♦endif RMgr->Control () ->VIMgr () ->Add β dParticipant(0, -1, -1, vi_rooa_id, lastjar rβturn(SUCCESS); ) int RooaFsa: :E40 action(IntβrObjectBuffers iob) { retur (E39 action(iob)) ; > int RoomFsm::E45 action(InterO jectBuffers iob) ( ♦ifdef STATE_MACH_TEST cout "" « "~ ********* J ^SJ SB Q. - « iast_sβq « endl; cout « "Room: ■ « vi_room_id « " • « real_rooa id « • E45 action: ■ « end eout « "Send MR_RESUME_MEETING to MR" « endl; ~ " "" ♦endif nextjnsg_prepare() ; RMgr->Control()->MRMgr()->ResumeMβeting(last_sβq, meeting->∑d() ) ; return(SUCCESS); } int RoomFsm::E46 action(InterObjectBuffers iob) ( ♦ifdef STATE_MACH_TEST cout " ~« " ********* χj_s_> SEQ: " « last_sβq « endl; eout « "Room: ■ « vi_room_id « ■ " « rβal_room_id « " E46_action: " « end eout « "Send EVE MEETING_R£SUMED to peer CMs/VI" « endl; ~ ♦endif RMgr->Cont rol ( ) ->VIMgr ( ) ->MβetingResuaβd ( 1 , vi_room_id) ; RMgr->Cont rol ( ) ->ENMgr ( ) ->MeetingResumed ( rβal_room_id, meeting->Id ( ) , meet ing->PartListWithoutMe ( ) ) ; return (SUCCESS) ; } int RoomFsm: :E47_action(InterObjectBufferS iob) { ♦ifdef STATE MACH TEST cout~~« " "" ********* IAST SEQ: " « last_seq « endl; cout « "Rooα: " « vi_room_id « - " « rβal_rooa_id « " E47_action: " « en cout « "Send EVE_MBETING_RESUMED failed to VI" «~ * endl; . ♦endif RMgr->Control()->VIMgr()-_HeetingResumed(0, vi_rooa_id ) ; return(SUCCESS); } int RooaFsa: :E56_action(InterObjectBufferS iob ) t return(E6_action(iob)); 1 int RoomFsm: :E58_action(InterObjectBuffers iob) { retur (E68 action(iob) ) ; int RooaFsa: :E9 action (InterOb jectBuf fers iob) { " retur (E32 action (iob) ) ; ) int RooaFsa: :E10 action (InterOb jectBuf fers iob) { nβxt_asg_prβpare () ; // this is the tiaβ to fill fulljaβdia as we would have // added all needed servers. Note that full j nβdia should // also be updated whenever we add a new server fulljDβdia - rβqjaedia; aeeting - new Meeting(iob.Repjnr_create_meeting.meeting id, "" " ~ ~ this, RMgr); if (imβeting) { ) cout « "Fatal Mβa Alloc Error: " « FILE-— « (int)—-LΣNE-____. « endl; mβeting->add_participant(RMgr->MySelf() , reqjnedia) ; ♦ifdef STATE_MACH_TEST cout « "~ ********* iASj EQ: « « last_seq « endl; cout « "Room: " « vi_room_id « " " « rβal_room_id « " E10_aetion: " « endl; cout « "Send MR GET PERSON_ΣNFO to MR for aeeting: " « mββting->Id() « endl; ♦endif "" "" RMgr->Control()->MRMgr()->GβtPersonInfo(last_seq, last_part_id) ; return(SUCCESS) ; } int RoomFsm: :E25 action (InterOb jectBuf ferS iob) t vi_room_id * » iob.Rβp_vi_meeti_ng_invitation.vi_room_id; aceepted nedia - iob.Rep_vi_meeting_invitation.med; ■ reqjnedia. update_applicable_aedia (aceeptedjnedia) ; my_room ■ 0; ♦ifdef STATE_MACH_TEST cout « " ********* LAST SEQ : " « last_seq « endl; cout « "Room: " « vi_room_id « ■ " « real_room_id « " E25_action: " « endl; cout « "Send EVE_ACCEPT_INVITATION to calling CM: NumServers :~" « aceeptedjnedi cout « "*** WAIT STATE ***" « endl; ♦endif List (int) plist; plist . insβrtjaext (pββr_part_id) ; RMgr->Control ( ) ->ENMgr () ->Accept Invitation (rβal_room_id, meβting->Id () , aceeptedjnedia, plist) ; set_invitβ_tiaβr (INVITEJTIMEOUT) ; return (SUCCESS) ; } int RoomFsm: :E26_action(InterObjectBufferS iob) { next jnsg orepare ( ) ; ♦ifdef STATE MACH_TEST cout ""« ■ ********* AST SEQ : " « last_seq « endl; cout « "Room: " « vi_room_id « ■ ■ « real_room_id « " E26_action: " « endl; cout « "MEETING IN PROGRESS . . . " « endl; ♦endif . MediaBrldgeDesc *b; int nserv - iob.eve_added_participant.med.length() ; for (;nserv; nserv—) { if ( io b .eve_aσ-» β d_participant.a β d.next_bridgβ to service(b) — SUCCESS ) { if ( accepted aedia.is prβsent(b>) { ~ ♦ifdef STATE_MACH_TEST cout << "Send M*N_COMNECT_TO_BRIDG_B for Media: " « (int)b->a « " Udesc: " « b->udββc « « Addr: • « b-> β -achinβ « ":: ■ « b->port « endl; ♦endif RMgr->Control()->LMMgr()->ConnβctToBridgβ( r β al_rooa_id, b->a, b->udβsc, b- aacbinβ, b->port) > ) } return(SUCCESS) ; } int RooaFsa: :E27 action(InterObjectBufferS iob) { ♦ifdef STATE_MACH_TEST cout~« " "" ********* 1AST SBQ. - « ι aat _aβq « endl; cout « "Rooa: ■ « vi_rooa_id « ■ " « real_rooa_id « ■ E27_action: " « endl; cout « "Send εVE_REJECT_INVITATΣON to calling CM" « endl; ♦endif RMgr->Control()->ENMgr()->Rβjectlnvitation(real_rooa_id, aeβting->Id() , meβting->PartListWithoutMβ()) ; return(SUCCESS) ; > int RooaFsa::E31 action(InterObjectBufferS iob) I nextjnsgjprepare() ; real_rooa_id «■ iob.Rβpj_-r_create_room.rooa_id; ♦ifdef STATE_MACH_TEST cout~ " « " "" ********* LAST SEQ: " « last_seq « endl; cout « "Rooa: " « vi_rooa_id « " • « real_rooa_id « " E31_action: " « endl; cout « "Send MR_CREATE_MEETING to MR " « endl; ♦endif RMgr->Control()->MRMgr()->CreateMeeting(last_seq, real_room_id) ; return(SUCCESS) ; int RoomFsm: :E32_action(InterObjectBuffers iob) ( nextjnsgjprepare ( ) ; reqjnedia .updatβ_prev_request ( iob. Rep jnr_add_sβrver .machine, iob. Rβp_mr_add_server. port, MEDIA_ ♦ifdef STATE MACH_TEST cout « " ********* LAST SEQ: " «- last_seq « endl; cout « "Room: " « vi rooa_id « " " « rβal_rooa_id « " E9/E32_action: " « en cout « "Send MAN_CONrøCT_TO_BRIDGE : " « iob. Rβp_ar_a«id_sβrvβr. machine « " " « iob. Rep j__r_add_server. port « endl; cout « "Send MR_CREATE_MEETIira to MR " « endl; ♦endif RMgr->Control0->LMMgr()-x;onnectToBridge( real_room_id, reqjnedia.LastMedla()->m, reqjnedia.LastMedla()->udesc, reqjnedi .LastMedla()->machine, reqjnedia.LastMedla()->port) ; RMgr->Control{)->MRMgr()->CreateMeeting(last_seq, real_rooa_id ) ; return (SUCCESS) ; } int RooaFsa: :E34_action(InterObjeetBufferS iob) { ae β ting->add_participant (last_part_id, ncceptedjnedia) ; fulljn β dia. update applicablejnediaTaecepted media) ; ♦ifdef STATE _MACH_TE3T " ~ ~ cout « " ********* U^SJ SB Q . . « ι a st_sβq « endl ; cout « "Room: • « vi_rooa id « " ■ « real rooa id « " Meet: ■ « a β eting->Id () «~" E14/E34_action:~ ■ << endl; cout « "Send EVE_ADDED_PARTΣCIPANT tή all peer CMa : NuaServers : " « accβptβd media. length () « endl; cout « "Send EVE_VT_ADDED_PARTICIPANT success to VI" « " ~ — lastjpart id « endl; cout « "MEETING IN PROGRESS "? ♦endif RMgr->Control ( ) ->VIMgr ( ) ->AddβdParticipant (1, real_rooajLd, xneeting->Id () , vi_ro last_p*rt_id, aceepted_aedia) ; RMgr->Control ( ) ->ENMgr ( ) ->AddβdParticipant ( rβal_rooa_id, aββting->Id ( ) 7 last_part_id, aceeptedjnedia, meeting- >PartListWithoutMe () ) ; return (SUCCESS) ; ) Lnt RoomFsm: :E41_aetion (InterOb jectBuf fers iob) ♦ifdef STATE_MACH_TEST cout « " ********* IASΪ SEQ: " « last_seq « endl; cout « "Room: " « vi_rooa id « " " « realjcooa id « " E41_action: " « endl; cout « "Send MR LEAVE MEETING to MR" « endl; ~ * ♦endif next jssgjprepare () ; RMgr->Control ( ) ->MRMgr ( ) ->LeaveMeet ing ( last_seq, mβeting->Id ( ) , reqjnedia) ; // last par. i RMgr->Control ( ) ->ENMgr ( ) ->Mββt ingLβf t ( rβal_rooa_id, aββting->Id ( ) , RMgr->MySβlf (> , " reqjnedia, aeeting->PartListWithoutMe () ) ; return (SUCCESS) ; ) int R oomFsm: :E42_aetion(InterObjectBufferS iob) { ♦ifdef STATE MACS. TEST cou t"~« " ********* IΛST SEQ: " « last_seq « endl ; cout « "Room: " « vi_rooa_id « " " « real_rooa_id « " E41_action: " « endl ; cout « "Send MR_REENTER_MEETING to MR" « endl; ♦endif // leave j nedia ■ iob.evβ_vi_add_participant.med; next j nsg j rβparβ() ; RMgr-x:ontrol()->MRMgr(>->ReenterMeeting(last_seq, meβting->Id () , leave media); return(SUCCESS); . int RoomFsm: :E43_action(InterObjectBufferS iob) iifdef STATE_MACH_TEST ^ ^ ^ . ^ last _ 9eq κ< ^ cout « "Room: " « vi_room_id « " " « real_room_id « - E41_action: " « endl ; cout « "Send EVE_REENTER MEETING to all peer CMs an d VT - « ♦endif endl; RMgr->Control ( ) ->VIMgr ( ) ->M ββ tingRββnterβd(l, vi rooa id, RMgr->MySβlf(), ϊβavβ "" sαdia); RMgr->Control () ->ENMgr()->MββtingReentβred(rβal_room_ϊd, a ββ ting->Id(), RMgr->MySβlf(), leavβ j nβdia, a β eting->PartListWithoutMβ()); return(SUCCESS) ; J int RoomFsm::E44_action(InterOb ectBuf erS iob) { ♦ifdβf STATE_MACH_TEST cout « "~ ********* U^SJ S]B Q. - << ι aat _ sβq « βndl . cout « "Room: " « vi_room_id « " • « rβal_rooa id « " E41 action: " « end cout « "Send EVE_REENTER MEETING fail to VI" « βήdl; "* ♦endif RMgr->Control()->VIMgr()->MββtingRβentβrβd(0, vi_rooa_id, RMgr->MySβlf(), ϊβavejnedia) ; return(SUCCESS) ; ) int RooaFsa: :E48_action (InterOb jectBuf ferS iob) { next _asg_prepare ( ) ; ♦ifdβf STATE_MACH_TEST cout « " ********* LXSI SEQ. » « iast_sβq « endl; cout « "Rooa: " « vi_rooa_id « " " « rβal_rooa_id « " E48_action: " « end cout « "Send MR ADD SERVER : " « iob. eve vi_add_server. aed. udesc « " " « io ♦endif lastjned - iob.eve_vi_add_server.aed; RMgr- >Cont rol ( ) ->MRMgr ( ) ->AddServer ( last_sβq, real_rooa_id, lastjned.m, lastjned. ude set_invite_timer (INVITE_TIMEOUT) ; return (SUCCESS) ; ) int RoomFsm: :E49_action ( InterOb jectBuf ferS iob) { ♦ifdef STATE_MACH_TEST cout « " ********* LAST SEQ: " « last_seq « endl; cout « "Room: " « vi_room_id « " " « real_room_id « " E49_action: " « end cout « "Send MAN_CONNECT_TO_BRIDGE: " « iob.Rβp_mr_add_server.machine « " " iob.Rβp mr_add_server.port « endl; ♦endif reset_invitβ_tiaer () ; lastjned. machine - iob. ep_mr_add_server . machine; lastjned. port - iob. Rep_mr_add_server. port; RMgr->Cont rol { ) ->I_MMgr ( ) -XTonneetToBridge ( real_room_id, lastjned.m, lastjned.udesc, lastjned.machine, lastjned.port) ; RM q r->Control()->ENMgr()->Serverλdded(real_room_id, lastjned, _,. ~ * meeting->PartLι RMgr->Control()->VIMgr()->ServerAdded(1, vi_room_id, lastjned ) ; return(SUCCESS) ; ) int RooaFsa::E50_aetion(InterObjectBuffers iob) ♦ifdef STATE_MACH_TEST cout « " ********* u^s, gEQ . . < lΛBt < βndl; cout « "Rooa: - « vi_rooa_id « " « « rβal rooα id « " ESO ac t ion: ■ « e cout « "Send EVE SERVER ADDED fail: ■ « βndϊ; ~ ~ ♦endif rβset_invite_tiaβr(); RMgr- Controϊ () ->V Mgr () ->S β rv β rAdded<0, vi_rooa id, last aed); return(SUCCESS); ~ } int RoomFsm::E51 action(IntβrObjectBuffers iob) { nextjssgjprepare(); ♦ifdβf STATE_MACH_TEST cout~« "~ ********* jasy stQ . m « las ^ β q « βadl . cout « "Rooa: " « vi_rooa_id « " " « rβal_room id « " E51_action: " « en cout « "Send MR_DROP_SERVER : " « iob.βvβ_vT addTsβrvβr.aed.udesc « " ■ « ♦endif lastjBβd - iob.eve_vi_drop_server.med; RMgr->Control()->MRMgr " {)->DropServer(laat sβq, rβal_room_id, last med.m, lastjned.ud set_invitβ_tisαr(INVITE_TlMEOUT); "" return(SUCCESS); } int RooaFsa: :ES2 action (InterOb jectBu fers iob) { ♦ifdβf STATE_MACHJTEST cout "* « " "" ********* XAS SEQ: ■ « last_seq « endl; cout « "Room: " « vi_room id « " " « real_room id « " E52_action: " « en cout « "Send MAN DISCONNECT FROM BRIDGE : " « endl; ♦endif reset_invite_timer ( ) ; lastjnβd.machine - "" ; // HACK lastjned. port - 0; RMgr->Control ( ) ->L»lgr ( ) ->DisconnectFromBridge ( real_rooa_id, lastjned. a, lastjned . udesc , lastjned .machine , lastjned. port) ; RMgr->Cont rol ( ) ->ENMgr ( ) ->ServerDropped < real_room_id, lastjned, "" meeting->PartL RMgr->Control ( ) ->VTMgr ( ) ->SβrverDropped ( 1 , vi_rooa_id, las jned) ; retur ( SUCCESS) ; ) int RooaFsa::E53_action(InterObjectBufferS iob) { ♦ifdef STATE MACH TEST cou t""« ■ ********* LAST SEQ: " « last_seq « endl ; cout « "Rooa: " « vi rooa_id « " " « real_room_id « " E53_action: " « e cout « "Send EVE_SERVER_DROPPED fail: " « endl; ~ ♦endif reset_invite_timer ( ) ; RMgr-X:ontrol ( ) ->VIMgr ( ) ->ServerDropρed(0 , vi_room_id, lastjned ) ; return (SUCCESS) ; RoomFsm: :E57_action (InterOb jectBuf fer iob) next jβsgjprepare ( ) ; ♦ifdβf STATE_MACH_TEST cout~« "~ ********* us, sχQ . . < lMt aφq < βadl ; COU < I^f * vi - r °oa_id « " " « real_rooa_id « - E13/E57 action : " « en cout « "Sead EVE_MEETΣNG_INVITE to (CM) part - « last_part_id « "" " in • « iob. R β p_r β g_get_p β rson_lnfo. aachine « " : : ■ « iob.R β p_r β g g β t_pβrson info. port « endl; cout « "Start timer. " « endl; ~~ ♦endif List (int) plist; plist . insβrt_next (last_part_id) ; Lis t_of p (PartMediaBridgeDeseLlst ) pmβd_list ; PartMediaBridgeDeseLlst *pned; ~~ List_of_pit β r ( Conferee) conf_list (aeβting->Conf βrβeList ( > ) ; Conferee "conferee; conf _list . reset ( ) ; while ( conf _llst .next (conferee) ) { if (confβrββ->Id() !- last_ρart_id) { pa β d - new PartMediaBridgeDeseLlst (conferee->Id ( ) , conf paed_list . insert_next (pmed) ; } } RMgr->Control ( ) ->ENMgr ( ) ->Mββt inglnvite ( rβal_rooa_id, meeting->Id ( ) , reqjnedia, plist, pmed_list) while (pααd_list . next (peed) ) { paed_list . res_ove_prev ( ) ; delete pαed; } sβt_invitβ_tijner (lNV TE_TΣMEOUT) ; return (SUCCESS) ; ) .nt RoomFsm: :E59_action (InterOb jeetBuff erS iob) reset_invite_timer ( ) ; next jssgjprepare 0 ; aceeptedjnedia - iob .eve_accept_invitation.med; reqjnedia. updatejψplicablejnedia (aceeptedjnedia) ; ♦ifdef STATEJMACHJTEST cout « " ********* ASX SEQ: " « last_seq « endl; cout « "Rooa: ■ « vi_room_id « ■ " « real_room_id « " E38/E59_action: " « en cout « "NUB Media Accepted : " « aceeptedjnedia. length «.endl; cout « "Send MR_ADD_PARTIC1PANT to MR " « last_part_id; ♦endif RMgr->Control()-«_RMgr()->AddParticipant(last_sβq, meβting->Id(), return(SUCCESS); } int RoomFsm: :E60_action(InterObjectBufferS iob) retur (E7_action(iob)) ; } int RoomFsm: :E61_action(InterObjectBuffers iob) a β eting->add_participant ( iob. β v β _addβd_part icipant .participant, * ♦i . # f . d « e_.*f S e -TA * -T*E_ « M » A,C-H___ -T*ES e -T iob. β ve_a ddβd _part icipant .med ) ; cout~« " ********* JJ^SJ SJQ . . «. _ Ast sβq < βndl; eout « "Rooα: " « vi_roca_id « ■ ■ « real rooa id « " Meet: ■ " « aeeting->ldT) « "" " E61_action: ■ << endl; cout « "Send EVE VI ADDED PARTICIPANT success to VI" « endl; ♦endif ~ "" RMgr->Control()->VIMgr()->AddβdParticipant{1, real_rooα_id, aeβting->∑d(), vi_rooa id, iob.βvβ_addβd_participant.participant, iob.eve_added_participant.aed); return(SUCCESS); } int RooaFsa::E62_action(InterObjectBufferS iob) { ♦ifdef STATE_MACH_TEST cout~« " ********* L S Ϊ SB Q. - « ι a st_seq « endl; cout « "Rooa: " « vi_rooa_id « " " « rβal_rooa_id « " Meet: " « aββting->IdT) « " Part: " « iob. teπpϊatel. participant « " E62_actio cout « "Send EVE DROPPED PARTICIPANT VI" « endl; ♦endif RMgr->Control()->VIMgr()->DroppedParticipant(1, vi_rooa_id, iob.teaplatel.participant)? meeting->drop_participant(iob.templatel.participant); retur (SUCCESS) ; } int RoomFsm: :E€3 action(InterObjectBufferS iob) { ♦ifdef STATE MACH TEST eout~« "~ ********* IASΪ SEQ: " « last_seq « endl; cout « "Room: ■ « vi_room_id « • ■ « rβal_room_id « ■ Meet: ~* « meeting->IdT) « " E61_action: " « endl; cout « "Send EVE_LEFT_MEETING to VI: " « iob.teaplatel.participant "" « endl; ♦endif RMgr->Control()->VIMgr()->MeetingLeft(1, vi_rooa_id, iob.ten_platel.participant, reqjnedia); // dummy media return(SUCCESS) ; } int R oomFsm: :E64_action(IntβrObjectBufferS iob) { ♦ifdef STATE MACH TEST cout ~« ■"" ********* LAST SEQ: " « last_seq « endl; cout « "Room: " « vi_rooa_id « " " « real_room_id « " Meet: " « aβeting->Id() « " E61_action: ■ « endl; cout « "Send EVE_REENTER_MEETING to VI: " « iob.teaplatel.participant « endl; ♦endif RMgr-x ontrol () ->VIMgr () ->MeetingReentered(l, vi_rooa_id, iob. tes-platel . participant, reqjnedia) ; // dusny media return (SUCCESS ) ; } int RooaFsa::E65_action(InterOb ectBufferS iob) < ♦ifdef STATE MACH TEST , ^ ^ ... cout * "« -~ ********* LAST SEQ: " « last_seq « endl ; cout « " R oom: " « vi_room id « " " « real_room_id « " E65_action: " << en d l cout « "Send MAN_CONNECT_τ " _BRIDGE: " « iob.teπplate7.med.machine « " « io b .template7.med.port « endl; ♦endif RMgr->Control ( ) ->LM«gr ( ) ->ConnectϊoBridgβ ( real_rooa_id, iob . template? .sαd.m, iob . template 7.aed. udesc, iob. template 7.mβd.aachinβ, iob.teaplate7.aed. port) ; RMgr->Control () ->VIMgr ( ) ->SβrvβrAddβd(l, vi rooa id. iob.teaplate7.aed) ; retur (SUCCESS) ; ) int RooaFsa: :E66 action(InterObjectBuffer iob) { ♦ifdef STATE_MACH_TEST cout « " ********* us 7 SE Q . - « inst_sβq « endl ; cout « "Rooa: • « vi_rooa_id « " • « rβal_rooa id « " E65_action: ■ « endl cout « "Send MAN_DlSCONNECT_FROM BRIDGE : ■ « iobTtβB-platβ7.aed. aachine « " " iob. emplate?. medTport « endl; ♦endif iob.template7.med. achine - ""; // HACK iob.teaplate7.med.port - 0; RMgr->Control()->I_MMgr()->DisconnectFromBridge( real_room_id, iob.template7.med.m, iob.template7.med.udesc, iob.template?.med. achine, iob.template?.med.port) ; RMgr->Control()->VIMgr()->ServerDropped(1, vi_room_id, ~ iob.template?.med) ; return(SUCCESS) ; . int RoomFsa: :E69 action(IntβrObjectBuffor6 iob) { ♦ifdef STATE J4ACH TEST cout « "Room: " « vi_rooa id « " " « real_rooa_id « " E69_action: " « endl cout « "Send EVEJMEETINGJDESTROYED to VT" « "" ~ " iob . template2. meet ing_id « endl; ♦endif RMgr->Control ( ) ->VTMgr ( ) ->MeetingDest royed ( 1 , vi_rooa_id) ; retur (SUCCESS) ; } int RoomFsm: :E70 action ( InterOb ectBuf fer iob) i ♦ifdef STATE_MACH_TEST cout « "Rooa: " « vi_rooa_id « " " « real_room_id « " E70_action: " « endl cout « "Send EVE_ROOM_DESTROYED to VI" « endl; ♦endif RMgr->Control()->VIMgr()->MeetingDestroyed(1, vi_rooa_id) ; return(SUCCESS) ; ) int RoomFsm: :E75_action(ΣnterObjectBuffer iob) { next jβsgj repare ( ) ; last_part_id - iob. evβ_vi_add_participant .participant; reqjnedia "" " iob . eve_vi_add_part icipant .med; ♦ifdef STATB MACH TEST _ cout~« " ********* L ST SEQ: " « last_seq « endl; cout « "Room: " « vi_room_id « " " « real_room_id « " E75_ac ion: " « end * H < * C ° Ut < " S#D MR - ββτ - PE " β « »ro fc o MR f or meeting: - « aeβting->Id () « " P RMgr-x:ontrol () ->MRMgr () -XSetPersonInf o (last seq, last j part i d ) ; re turn (SUCCESS) ; ~ ~^ — ) int RoomFsm: :E76 action (IntβrOb jectBuf erS io b ) { return (E39 action (iob) ) ; J int RooaFsa: :E77_action (InterOb jectBuf ferS iob) { ♦ifdef STATE_MACH_TEST cout « " ********* ϊ^as j SBQ . . <<c ι aat _ aβq « βndl . cout « "Rooa: ■ « vi_rooa_id « - " « rβal_rooa id « • E77 action: " « en cout « "Send EVE MEETING_SUSPENDED to VI" « endl? " " ♦endif ~ RMgr-Xϊontrol()->VIMgr()- MββtingSuspβndβd(1, vi_rooa_id) ; retur (SUCCESS) ; } int RooaFsa::£78 action(InterObjectBufferS iob) { nextjssgjprepare(); last_part_id - iob.βvβ_vi_drop_participant.participant; ♦ifdef STATE_MACH_TEST cout « " "* ********* SEQ: " « last_seq « endl; eout « "Rooa: " « vi_room_id « ■ ■ « real rooa id « " E78 action: " « en cout « "Send MR_DROP_PARTICIPANT to MR for :~" « "" ~~ iob.eve vi_drop_participant.participant « endl; ♦endif ~ RMgr- tontrol()->MRMgr()->DropParticipant(last_seq, mββting->Id(), iob.βve_vi_drop_participant.par set_invite_timer(INVITE_TIMEOUT) ; return(SUCCESS) ; } int RoomFsm: :E79_action(InterObjectBufferS iob) { ♦ifdef STATE_MACH_TEST cout « " ********* LAST SEQ: " « last_seq « endl; cout « "Room: " « vi_rooa_id « " " « real_rooa_id « " Meet: " « meeting->IdT) « " E79_action: " « endl; cout « "Send EVE DROPPED_PARTICIPANT VI : - « last_part_id « endl; ♦endif RMgr-X^ntrol()->VIMgr()->DroppedParticipant(1, vi_room_id, RMgr->Control()->ENMgr()->DroρpedParticipant(real_room_id, meeting->Id(), lastjpart_id, mee ing->PartListwithoutMe0) meβting->drop_participant(last_part_id); return(SUCCESS) ; } int RoomFsm: :E80_action(ΣnterObjectBufferS iob) { ♦ifdef STATE MACH_TEST . cout~« " **** * ** * * LAST SEQ: " « last_seq « endl ; cout « "Room: " « vi_room_id « " " « real_room_id « " Meet: " « meeting->Id{) « " E80_action: " « endl ; cout « "Send EVE_DROPPED_PARTICIPANT VI : " « last_part_id « endl ; ♦endif RMgr->Control ( ) ->VIMgr ( ) ->DroppedParticiρant (0, vi_room id, ,._-__. iob. teaplatel .participant) ; return (SUCCESS) ; - } int RooaFsa::E81 action(IntβrObjectBuffβrt iob) i next_asg_prepare(); r β q_a β dia.updatβ_prβv_rβquβst("", 0, MEDIΛJJNSET); ♦ifdef STATE_MACH_TEST cout « " ********* AST SEQ: ■ « laat_sβq « en d l; cout « "Rooa: " « vi_rooa_id « " " « real rooa id « • E81 action: ■ « en cout « "MR_ADD_SERVER failed" « endl; ~ ~ cout « "Send MR_CREATE_MEETING to MR " « endl; ♦endif RMgr-Xontrol () ->MRMgr{)->CreatβMβeting<last_seq, real rooa_id); return(SUCCESS); "" "* 1 int RooaFsa::E82 action(IntβrObjectBufferS iob) { next_msg_prβparβ() ; reqjnedia.update_prβv_rβquest("", 0, MEDIAJJNSET) ; ♦ifdef STATE_MACH_TEST cout~« " ********* AST SEQ: " « last_seq « endl; eout « "Rooa: " « vi rooa_id « ■ " « real rooa_id « * E82_action: ■ « en cout « "MR_ADD_SERVER "* failβd" « endl; "* cout « "Send MR ADD SERVER to MR: NuaServers: " « reqjnedia.num_yet_to servi ♦endif ~ "* MediaBrldgeDesc *b; if (reqjnedia.next_bridge_to_serviee(b) —- SUCCESS) { RMgr->Control()->MRMgr()->AddServβr(last_3βq, rβal_rooa_id, ♦ifdef STATE_MACH_TEST cout « "Media: " « (int)b->m « " Udesc: " « b->udesc « endl; ♦endif } return(SUCCESS) ; > int RoomFsm: :E83 action(InterObjectBuffer iob) int ret - E79_action(iob); ♦ifdef STATE_MACH_TEST cout « "Tβrainating the FSM ... " « endl; ♦endif return(ret); ) int RoomFsm::E84_action(IntβrObjectBufferS iob) { next_msg_prepare() ; req_media ■ iob.Rep_list_servers.med; ♦ifdef STATE MACH_TEST , ^ ., cout~« " ********* LAST SEQ: " « last_seq « endl ; cout « "Room: " « vi_room_id « " " « real_room_id « " E84_action: " « en cout « "Send MR_CREATE_MEETING to MR " « endl ; ♦endif MediaBrldgeDesc *b; int nserv - reqjnedia.length() ; for (;nserv; nsβrv—) ( if ( reqjnedia.next_bridge to service(b) —- SUCCESS) ( ♦ifdβf STATE_MACH_TEST ~ ~ cout « "Send MAN_CONNECTjrθ_BRIDGE for Media: " « (int)b->m « " Udesc " : " « b->udβsc « " Addr: " « b->machinβ « "::" « b->port « endl; ♦endif RMgr->Control()->IMMgr()->ConnβctToBridge( r β al_rooa id, b- m, b->udβsc, b->machinβ, b- RMgr-xontrol(>->VTMgr()->SβrverAddβd(1, vi_room_id, ) RMgr-XIontrol ( ) ->MRMgr ( ) -XZrβatβMββt ing ( last seq, rβal_rooa_id) ; return(SUCCESS) ; ~~ ~ ) int RoomFsm::E86_action(IntβrObjectBuffers iob) { last_part_id - iob.templatβ2.src_part; ♦ifdef STATB_MACH_TEST cout~« " "" ********* LAS. SEQ: " « last_seq « end cout « "Room: " « vi rooa_id « " " « rβal_rooα_id « " E86_aetion: " « cout « "Send EVE VI_JOIN MEETING to VI for : " « last_oart_id « endl; ♦endif "" RMgr-x:ontrol()->VIMgr()->JoinMeβting(vi_rooa_id, last_part_id) ; return(SUCCESS) ; ~ } int RooaFsa::E88 action(InterObjectBuffers iob) { List(int) plist; ♦ifdef STATE_MACH_TEST cout "" « " "" ********* LAST SEQ: " « last_sβq « end cout « "Rooa: " « vi rooa_id « " • « real_rooa_id « " E88_action: " « cout « "Send EVE_JOΣN~MEETΣNG_REJECTED to peer CM" « endl; ♦endif plist. insβrt_next (lastj art_id) ; RMgr-XIontrol ( ) ->ENMgr ( ) -> JoinMeetingRe jected ( real_room_id, plist ) ; return (SUCCESS) ; } int RoomFsm::E90_action(InterObjectBufferS iob) ( ♦ifdef STATHJMACHJTEST cout « " ****** * ** LAST SEQ: " « last_seq « end cout « "Room: " « vi_room_id « " " « real_room_id « " E90: " « endl ; eout « "Terminating FSM..." « endl; ♦endif RMgr-X ontrol ( ) ->VIMgr ( ) ->MeetingDestroyed (1, vi_room_id ) ; return (SUCCESS) ; ) int RoomFsm: :E91_action (InterObjectBufferS iob) { ♦ifdef STATE MACH TEST cout~« """ ********* LAST SEQ: " « last_seq « end cout « "Room: • « vi_room_id « " " « real_room_id « " E91: " « endl ; cout « "Terminating FSM—" « endl; ♦endif RMgr-x:cr.- „ -ol ( ) ->VIMgr< ) ->MeetingDe3troyβd(-ι, rβal_rooa_id> ; return (SUCCESS) ; ) ♦define STATE_MACH SiST //♦define DUMMY_MA I ♦include <statβ.h> ♦include <sysent .h> List_of_piapleaent(RooaFsa) List_of_pis-plβaβnt(Conferee) RoomFsm: :RoomFsm(int p_vi_room_id, int p_rβal_room_id, InterObjβetBuffers iob, RooaFssMgr* agr) RMgr - agr; aeeting - NULL; vi_rooa_id - p_vi_room_id; real_room_id - p_rβal_rooa_id; invite_timeout - -1; ~ * my_room «■ 1; ♦ifdef STATE_MACH_TEST cout « "VI_ROOM_ID: " « vi_room_id « " REAL ROOM ID: " « real room id « ♦endif ~ ~ ~ currβnt_statβ - STJSround; for (int i - 0; i < MAX_NUM_FSM_STATES; 1++) ( for (int j - 0;~j < MAX_NUM_FSM_TRANSITIONS; j++) { if (j — T56) register_transition(i, T56, ST_Tβrminatβ, SRoomFsm: :terainate_aetion) ; else " ~ register_transition(i, j, i, SRoomFsm: :default action) ; } } register_transition(ST_Ground, TI, STJNewRoom, SRoomFsm: :El_action) ; register_transition(ST_Ground, T2, ST_ListServersWait, SRoomFsm::E2_action) ; register_transition(ST_ListServersWait, T60, ST feetCreatedWait, ~SRoomFsa::E84_action) ; register_transition(ST_ListServersWait, T61, STJTeraiaate, ~ ~SRoσmFsm: :E6_action) ; register_transition(ST_Ground, T3, ST_ExistingMeet, SRoomFsm::E3_ac ion) ; register_transition(ST_Ground, T4, STJMeetlnvitation, SRoomFsm::S4_action) ; rβgister_transition(ST_NewRooa, TS, ST_RooaCreated, SRoomFsm::E5_aetion) ; register_transition(ST_NewRoom, T6, ST_Terminate, ~ SRoomFsm::E6_action) ; registβr_transition(ST NewRoom, T23, ST_MeetCreatedWait, ~ _ SRoomFsm: :E31_action) ; register transition(ST RoonCreated, T8, ST teetCreatedWait, ~ "" SRoomFsm: :E32_action) ; register transition(ST RoonCreated, T58, STjteetCreatedWait, ~ ~ SRoomFsm: :E81_action) ; register transition(ST_RoomCreated, T57, ST_RoomWithServers, — SRoomFsm::E82_action) ; register_transition(ST_RoomCreated, T7, ST_RoomWithServers, SRooaFsa: :E7_action) ; r β gist β r_trahsition (ST_Rooπ_WithServer3, T8, ST_MβetCreatedWait, SRooaFsa: :E9_aetion) ; r β gist β r_transit±on (ST_RooaWithSβrvβrs, T7, ST_Roθ-__MithServers, ~ SRooaFsa: :E60 action) ; regist β r_transition (ST_RooaMithServers, TS7, STjteetCreatedWait, SRooaFsa: :B82 action) ; register_transition(ST_RooaMithSβrvers, T58, STjteetCreatedWait, SRooaFsa: :E81_action) ; registβr_transition (STjteetCreatedWait, T24, ST_Tβrainatβ, ~ SRooaFsa: :B33_action) ; rβgistβr t ransit ion (STjteetCreatedWait, T67, STJteetlnProgress", ~ SRooaFsa: :E8_action) ; register_transition (STjteetCreatedWait, T9, ST PersonlnfoWait, ~ SRooaFsa::E10_ac ion) ; register_transition(ST_PersonΣnfoWait, T41, ST_Tβrainatβ, SRooaFsa::E56__action) ; register_transition(ST_PβrsonΣnfoWait, T40, STJMeβtAccβptWaitT SRoomFsm::ES7_action); registβrjtransition(ST_MeetAcceptWait, T26, ST_Terainate, ~ " "" SRooaFsa::E58_action); registβr_tran3ition(ST_MββtAcceptWait, T13, STJMββtAddPartWaitl, ~~ SRooaFsa::ES9_action); register_transition(STJteetλcceptWait, T48, ST_Tβrainate, ~ SRooaFsa::E68_action); registβr_transition(STJteetAeceptWait, T56, STJTerainate, "" "" SRooaFsa::E68_action); register_transition(STJteetAddPartWaitl, T25, STJTerainate, ~ " SRooaFsa: :E37_aetion) ; rβgister_t ransit ion (STJteetAddPartWaitl, T10, STJteetlnProgress, ~ " "" 6 * RooaFsa: :E34_action) ; register_transition (ST MeetAddPartWaitl, T56, ST_Tβrainate, ~ SRoomFsm: :S68_aetion) ; register_t ransit ion (ST_ExistingMβet, T4, STJteet Invitation, — SRooaFsa: :E4_action) ; register_transition(ST ExistingMeet, T22, ST_Terminate, ~ SRoomFsm: :E29_action) ; register_transition (ST ExistingMeet, T48, STJTerainate, ~ SRoomFsm::E68_action) ; register transition(ST MeetInvitation, T21, ST_Terminatβ, ~ "" SRoomFsm::ε27_action) ; register_transition(ST MeetInvitation, T19, ST_WaitForPeerCMAdd, ~ SRoomFsm::E25_action ; register transition(STJteetlnvitation, T49, ST_Terainate, • SRooaFsa::E91_action) ; register transition(ST Meβtlnvitation, T50, ST_Terainate, ~ ~ SRoomFsm: :E91_action) ; register transition (ST WaitForPeerCMAdd, T20, STJteetlnProgress, - ~ SRoomFsm::E26_action) ; register transition(ST WaitForPeerCMAdd, T48, ST_Terminate, "" — SRoomFsm::E90_action) ; register transition(ST WaitForPeerCMAdd, T49, ST_Tβrainate, ~ ~ SRoomFsm::E90_action) ; register transitio (ST WaitForPeerCMAdd, T50, ST_Terminate, — ~ SRoomFsm: :E90_actιon) ; register transition (ST MeetlnProgress, T42, STJteetlnProgress, ~ SRoomFsm: :E61_actιon) ; r β gist β r_transition ( STJteetlnProgress, T43, STJteetlnProgress, SRooaFsa: :E62 action) ; r β gister_tranaition ( STJteetlnProgress, T44, ST_MββtInProgrβss7 SRooaFsa: :E63 action) ; r β gist β r_transition ( STJteetlnProgress, T45, STJteβtlnProgrβssT SRoomFsm: :E64 action) ; r β gister_transitio ( STJteetlnProgress, T46, ST_MββtΣnProgress7 SRooaFsa: :E65 action) ; r β gist β r_transition ( STJteetlnProgress, T47, STJteβtΣnProgrβssT SRooaFsa: :E66 action) ; regist β r_transition ( STJteetlnProgress, Til, ST_Tβrainatβ, "" SRooaFsa: :E12 action) ; register_transition ( STJteetlnProgress, T49, ST_Tβrainatβ, — ~ SRooaFsa: :E69_action) ; registβr_transition (STJteetlnProgress, TSO, ST_Terainate, ~ " SRooaFsa: :E70_action) ; rβgister_transition (STJteetlnProgress, T12, ST_PβrsonInfoWait2, SRooaFsa: :E75_action) ; rβgistβr_transit ion (STJteetlnProgress, T27, ST_SelfOnHold, ~~ SRooaFsa: :E41_action) ; rβgistβr_t ransit ion (STJteetlnProgress, T14, STJteβtSuspβndβdWait, — SRooaFsa: :E15_action) ; register_transition (STJteetlnProgress, T17, STJteβtSuspended, SRooaFsa: :E77_action) ; rβgister_transition (STJteetlnProgress, T37, ST_DropServerWait, SRooaFsa: :ESl_action) ; rβgistβr_transition (STJteetlnProgress, T34, ST_AddServerWait, SRooaFsa: :E4β_action) ; rβgistβr_transition (STJteetlnProgress, T51, ST_DropPartWait, ~ " ~ " SRooaFsa: :E78_action) ; rβgi3ter_transition (STJteetlnProgress, T62, ST_JoinMββtWait, SRooaFsa: :E86_action) ; register_transition(ST_JoinMβetWait, T65, ST_MββtInProgrβss, "" "" SRooaFsa::E88_action) ; regi3ter_transition(ST_JoinMeetWait, T12, STJ?ersonlnfoWait2,~ "" " ~ SRooaFsa: :E75_action) ; /* Self Loops */ register transition(ST_JoinMeetWait, T44, ST_JoinMeet ait, ~ * SRoomFsm::E63_action) ; register_transition(ST JoinMeetWait, T45, ST_JoinMeetWait, ~ "" SRoomFsm: :ε64_action) ; register transition(ST_JoinMeetWait, T46, ST_JoinMeetWait, " * ~ SRoomFsm::ε65_action) ; register transition<ST_JoinMeetWait, T47, ST_JoinMeetWait, ~ "" "" SRoo Fsa: :E66_action) ; register transition(ST_JoinMeetwait, T42, ST_JoinMeetWait, "" "" ~ SRoomFsm: :E61_action); register transition(ST_JoinMeet ait, T43, ST_JoinMeetWait, ~ SRoomFsm: :E62_action) ; register transition (ST_PersonInfoWait2, T49, STJTerminate, * " SRoomFsm: :E69_action) ; register transition(ST PersonInfoWait2, T50, STJTerminate, ~ "" SRoomFsm::E70_action) ; register transition(ST PersonInfoWait2, T41, STJteetlnProgress, — — SRoomFsm::E76_action) ; re β ister transition(ST PersonInfoWait2, T40, ST_MeetAddPartWaIt2, - "" SRoomFsm: :E13_action) ; reσister transition (ST MeetAddPartWait2, T49 , STJTerainate, - — ~ SRoomFsm: :E69_actιon) ; reqister transition (ST MeetλddPartWait2, T50 , ST_Terminate, — ~ SRoomFsm: :E70_actιon) ; register transition (ST MeetAddPartWait2, T26, ST_MeetInProgress, ~ — ~ SRoomFsm: :E39_actιon) ; r β gιst β r_transition ( ST_MeβtAddPartWait2 , T13 , STJMeetAddPartWait3 , SRooβFaa: :E3β action) ; regist β r_transition ( ST_M β βtAddPartWait2, T48, STJteetlnProgress, SRooaFsa: :E39_action) ; r β gist β r_transition ( ST_MββtAddPartWait3, T49, STJTerainate, . _ SRooαraa: :E69 action) ; regist β r_tranaition ( ST_Me β tAddPartWait3, T50, STJTexainate, ~ SRooaFsa: :E70 action) ; regist β r_tran β ition ( ST_M ββ tAddPartWait3, T25, STJMeβtΣnProgrβss, SRooaFsa: :E40 action) ; regist β r_transition ( STJMeβtAddPartWait3, T10, STJteetlnProgress, SRooaFsa::El4_action); registβr_transition(ST_SelfOnHold, T49, STJTerainate, SRooaFsa::E69_action) ; registβr_transition(ST_SelfOnHold, T50, ST_Tβrminatβ, "" SRooaFsa::E70_action); register_transition(ST_SelfOnHold, T28, ST_ReentβrAttβaρt, ~ SRooaFsa::E42 action) ; /* Self Loops */ "" rβgister_transition(ST_SelfOnHold, T44, ST_SelfOnHold, SRooaFsa::E63_action) ; rβgistβr_transition(ST_SelfOnHold, T45, ST_SelfOnHold, SRooaFsa::E64_action) ; register_transition(ST_SelfOnHold, T46, ST_SelfOnHold, SRooaFsa::E65_action) ; register_transi ion(ST_SelfOnHold, T47, ST_SelfOnHold, ~~ SRoomFsm: :E66_action) ; register_transition(ST_SelfOnHold, T42, ST_SelfOnHold, ~ SRooaFsa: :E61_action) ; register_transition(ST_SelfOnHold, T43, ST_SelfOnBold, SRooaFsa::E62_action); registβr_transition(ST_ReβnterAttempt, T49, STJTerainate, ~ SRoomFsm::E69_action) ; register_transition(ST_ReenterAttempt, TSO, STJTerainate, — "* SRooaFsa::E70_action); register_transition(ST_ReenterAttempt, T30, ST_SelfOnBold, SRooaFsa::E44_action) ; register_transition(ST_ReenterAttempt, T29, STJteetlnProgress, ~ SRoomFsm::E43_action) ; /* Self Loops */ register_transition(ST_RβenterAttempt, T44, ST_ReenterAttempt, "" SRooaFsa: :E63_action) ; register_transition(ST_RβenterAttempt, T45, ST_RββnterAttempt, * ~ SRooaFsa::E64_action) ; rβgistβr_transition(ST_RβenterAtteapt, T46, ST_ReβnterAtteapt, SRooaFsa: :E65_aetion) ; register transition(ST_RββnterAtteapt, T47, ST_RβenterAtte___pt, " " "" ~ SRooaFsa::E66_action) ; register transition(ST RβenterAttempt, T42, ST_ReβnterAttempt, ~ "" "" SRoomFsm::E61_actlon) ; register transition(ST RβenterAttempt, T43, STJFteenterAttemp , ~ SRooaFsa::E62_action) ; register transition(STJteetSuspendedWait, T49, STJTerminate, ~ SRooaFsa::E69_action) ; register transition(STJteetSuspendedWait, T50, STJTerainate, ~ SRooaFsa::E70_action) ; register transition(ST_MβetSuspendedWait, T15, STJteetlnProgress, ~ SRooaFsa::E16_action) ; register transition(STJteetSuspendedWait, T16, STJMeetSuspended, — SRoomFsm: :E17_action) ; register_transition(STJMeetSuspended, T49, ST_Terminate, 295 NOT FURNISHED UPON FILING SRooaFsa: :E69 action) ; regist β r_t ransit ion (STJMeetSuspended, T18, STJteetlnProgress,- SRooaFsa: :E19 action) ; regi β t β r_t ransit ion (STJteβt Suspended, T31, STJteetResuaβWait, SRooaFaa: :E45_action) ; regist β r_transition ( ST_M β βtRβsuaβWait, T49, ST J Terainate, " " SRooaFsa: :E69 action) ; r β gister_transition ( ST_MeetRβsus»Wait, T33, STJMeetSuspended, "" " " SRooaFsa: :E47 action) ; r β gister_transition ( ST_MoetRβsuaeWait, T32, STjMeetlnProgressT ~~ SRooaFsa::E46_action) ; registβr_transition(ST_AddSβrvβrWait, T49, STJTerainate, " ~ SRooaFsa: :E69_action); rβgister_transition(ST_AddServerWait, T50, ST_Tβxminatβ, ~ SRooaFsa::E70_action) ; rβgistβr_transition(ST_AddSβrverWait, T35, STJteetlnProgress, ' SRooaFsa::E 9_aetion) ; registβr_transition(ST_AddSβrvβrWait, TB, ST_MeβtInProgrβsβ, ~~ ~ " "" ~ " SRooaFsa::E49_action) ; register_transition(ST_AddServerWait, T36, STJteetlnProgress, SRooaFsa::E50_action); registβr_transition(ST_AddServerWait, T58, STJteetlnProgress, ~ SRooaFsa::E50_action) ; registβr_transition(ST_λddServerWait, T48, STJteetlnProgress, SRooaFsa::E50_action) ; register_transition(ST_DropServerWait, T49, STJTerainate, "" ~ " "" SRooaFsa::E69_aetion); register transition(ST DropServerWait, TSO, ST_Terainatβ, — "" "~ SRooaFsa::E70_ac ion) ; registβr_transition(STJDropSβrvβrWait, T38, ST_MββtInProgrβss7 "" ~ " SRooaFsa::E52_action); rβgister_transition(STJDropSβrvβrWait, T39, STJteetlnProgress, ~ SRooaFsa: :E53_action) ; register transition(ST DropServerWait, T48, STJteetlnProgress, — ~ ~ SRooaFsa::E53_action) ; register transition(STJDropPartWait, T49, ST_Terminate, ~ SRoeaFsα::E€9_ac ion) ; registβr_transition(STJDropPartWait, T50, STJTerainate, SRooaFsa: :E70_action) ; register transition(ST DropPartWait, T52, STJteetlnProgress, ~ ~ SRooaFsa::E79_action) ; register transition(STJDropPartWait, T59, STJTerminate, — SRoomFsm: :E83_action) ; register transition(ST DropPartWait, TS3, STJteetlnProgress, — — SRoomFsm: :E80_action) ; fire(iob) ; ) RoomFsm: :-RoomFsm() if (meeting) delete meeting; void RooaFsa: :nextjnsgjrepare last_seq » RMgr->NextSeqNo() ; int RoomFsm: :fire(InterObjectBufferS iob ) int input « TO; 297 NOT FURNISHED UPON FILING int Self - 0; int NuaServersR β q - reqjnedia.nua_yet_to_sβrvicβ() ; ♦ifdef STATB_MACH_TEST cout~ " « "lire: NuaServers: " « reqjnedia.nua_yet_to_service() « endl; ♦endif switch (iob.asg_type) ( ease EVENT_VI: " ~ switch (iob.asg_code) ( case EVE_CREλTε_MEETΣNG: case EVE~CREATE_PERSISTENT_MEETING: nput ■ TI; break; case EVE_VI_CREATE_MEET_IN_EROOM: input » T2; " break; case EVE_VI_JOIN_MEETING: input - T3; break; case EVE_JOΣN_MEETΣNG_REJECTED: input "" - T65; break; case EVE_ i_ADD_PARTICIPANT: input » "" T12; break; ease EVEJVIJDROPJPARTICIPANT: input • T51; break; case EVE_VI_SUSPEND_MEETING: " Laipiut - T14? break; ease EVE_VI_RESUMEJMEETING: input - T31; break; case EVEJVIJREENTERJMEETING: ϊαput - T2β7 break; case EVE_VT_LEAVE_MEETING: input - T27; break; case EVE_VΣ_ADD_SERVER: inpiάt - T34; break; case EVE_VI_DROP_SERVER: nput - T37; break; case EVE_VI_DESTROy_RO<_tt4: input - T55; break; case EVE_VI_DESTROY_MEETING: input » T56; break; de aul :- break; ) break; ease EVENT CM: switch (iob.asg_code) { case EVE_MEETΣNG_INVΪTE: input - T4; break; case EVE_DROPPED_PAR ICIPANT: Self - (RMgr->MySelf() — iob.teaplatel.participant) 7 1 : 0 input - (Self) ? Til : T43; break; case EVE_JOΣN_MEETING: input - T62; break; case EVE_JOIN_MEETING_REJECTED: input - T64; break; ease EVE_ACCEPT_ΣNVITATION: input - T13; break; case EVE_REJECT_ΣNVITATION: input - T26; break; ease EVE_MEETING_SUSPENDED: input - T17; break; case EVE_MEETING_RESUMED: input - T31; break; case EVE ADDED_PARTICIPANT: Self - (RMgr->MySelf() — iob.eve_added_participant.particip input - (Self) ? T20 : T42; break; case EVEJLEFTJMEETING: input - T44; break; case EVE_R£ENTER_MEE ING: input " T45; break; case EVE_SERVER_ADDED: input ■ T46; break; case EVE_SERVER_DROPPED: input - T47; break; case EVE_MEETING_DESTROYED: input ■ T49; break; / 4209 case EVE_ROOM_DESTROYED: Input "" - TSO; break; default: break; ) break; case RE?LY_MR_SERVER: case ERROR~MR~SERVER: switch (iob.msg_code) { case MR_CREATE_ROOM: " if ( iob.asg_typ β — REPLY_MR_SERVER ti NuaSβrversRβq > 0) input - T5; ~ " if <iob.asg_type — REPLY_MR_SERVER SS NumServersReq — 0) input - T23; " ~ else if (iob.msg_typβ — ERROR_MR_SERVER) input - T6; ~~ "" break; ease MRjCREATEJMEETING: if (LastPartldO — RMgr->MySelf()) input - (iob.msg_type — REPLY_MR_SERVER) 1 T67 : T2 else ~ " ~ " input - (iob.msg_typβ — REPLY_MR_SERVER) 7 T9 : T24; break; "" "" " ~ case MR_LIST_SERVERS: " input - (iob.msg_type — REPLY_MR_. SER.VER) 7 TSO : T61; break; *" ~~ "* case MR_ADD_SERVER: if (iob.asg_type — REPLY_MR_SERVER it NumServersReq > 0) input - T7; *" else if (iob.msg_typβ — REPLY_MR_SERVER it NumServersReq — input - T8; else if (iob.msg_type — REPLY_MR_SERVER) input - T * 35; " else if (iob.msg_type — ERROR_MR_SERVER it NumServersReq > input - T57; else if (iob.msg_type — ERROR_MR_SERVER SS NumServersReq — input - T58; else if (iob.msg_type — ERROR_MR_SERVER) input - T36; break; case MR_DROP_SERVER: input - (iob.msg_type — REPLY_MR_SERVER) ? T38 : T39; break; case MR_ADD PARTICIPANT: input - (iob.msg_type — REPLY_MR_S1SRVER) ? T10 : T25; break; case MR_DROP_PARTICIPANT: // Should add T59 - Get last_part_id from FSM ???? if (iob.msg type — REPLYJMR SERVER SS last p rt _ id — RMgr->MySelf ()) input - TS9; else __ input - (iob.msg_type — REPLY_MR_SERVER) ? TS2 : T5 break; case MR SUSPEND MEETING: input - <iob.msg_type — REPLY MR SERVER) ? T16 : T1 S; break; " " ~ " case MR_REENTERJMEETING: " input - " (iθb.asg_typβ — REPLY_MR_SERVER) ? T29 : T30; break; " " case MR_RESUME_MEETING: " input - (iob.asg_typβ — REPLY_MR_SERVER) ? T32 : T33; break; "" ~~ default: break; 1 break; case REPLY_REGISTRY SERVER: case ERROR_REGISTRY~SERVER: switch (iob.asg code) ( case REG_GET_PERSON_INFO: input - (iob.asg_type — REPLY_REGISTRY_SERVER) 7 T40 : T41; break; " " default: break; } break; ease REPLY_V : ease ERRORJVI: switch (iob.asg code) ( case VΣ_MEETING~INVTTATION: input - " (iob.asg_typβ — REPLY_V1) ? T19 : T21; break; default: break; } break; case TIMEOUT: switch (iob.msg oode) { case TIMEOUT: input - T48; break; default: break; ) break; default: break; ) retur ( ire<input, iob) ) ; ) int RoomFsm: :fire(unsigned input, InterObjectBufferS iob ) { int ret; ♦i fdef DEBUG ^ w-?SM _ INpυτ . . « ^p^ « - current State: " « current_state « " ♦endif re t - ( this->*transitions lcurr β nt_statβ] [input] .action) (io b ) ; curr β nt_stat β - transitions (currβnt_state] [input] .des t ; return (ret) ; - ) void RooaFsa: : check update invite timer () f " InterOb jectBuf fβr iob; ♦ifdef DEBUG // cout « "invite_timβout : " « invite tiββout « endl; ♦endif ~ iob.asg_typβ - TIMEOUT; iob.msgjoodβ - TIMEOUT; if (invItβ_ti_mβout — -1) return; if (invitβ_tiaβout— — 0) { // fire now reset_invitβ_tiaβr() ; fire(Iob); } alarm(l); } // Meeting methods Meeting: :Meeting(int meeting_id, RoomFsm "proom, RoomFsmMgr "pRMgr) { id - mββting_id; RMgr - pRMgr; room — proom; status - e MNORMAL; } Meeting: :-Meeting() drop_all_participants() ; ) int Meeting: :add_participant(int participant, MediaBridgeDescList mlist) { Conferee *c; conf_list.reset() ; while " (conf_list.next(c) ) { if (c->Id() — participant) return(-ERR_PARTICIPANT_ALREADY_PRESENT) ; ) if (c - new Con eree(participant, mlist)){ conf llst.insert_nβxt(c) ; ~ if (participant !- RMgr->MySelf()) conf wo_aβ_list.insertjiext(participant) ; } else{ _ cout « "Fatal sea alloc error: " « __FILE__ « " " « _LINE_ « endl ; return(-ERR_NO_RESOURCES) ; 1 return(SUCCESS) ; } int Meeting: :drop_participant(int participant ) ( Conferee *c; drop_conf_wo_me_list(participant) ; conf_list.reset() ; while (conf list.next(c)) { ii ->∑d() — participant) { eonf_liat . rβαovβ prev ( ) ; return (SUCCESS) ; ) } return ( -ERR_PARTIC»ANT_NOT_PRESENT) ; ) void Meeting::drop conf_wo aa list(int participant) { int c; conf_wojaβ_list.reset(); while (conf_wo_mβ_list.next(c)) ( if (c —- participant) conf wo ae list.removβ_prβv() ; } } int Meeting: :suspend meeting() i if (status — e_MSUSPENDED) return<-ERR_MEETING_SUSPENDED) ; status - eJMSUSPENDED; return(SUCCESS) ; ) int Meeting: :resumejneeting() ( status - e_MNORMAL; return(SUCCESS); . void Meeting: :drop alljparticipants() { Conferee *c; conf_list.reset0 ; while (conf_list.next(c)) . delete c; conf_list.remove_prev() ; } int p; conf_wo_me_list.reset() ; while (conf_wo_me_list.next(p) ) { conf wόjnβ_list.rβmove_prev() ; ) } void Meeting: :add_media(int participant, MediaBrldgeDesc aed ) { List_of j itβr(Conferee) clist(conf_list) ; Conferee *c; clist.reset() ; while (clist.next(c) ) { if (c->Id() — participant)! c->add_media(med) ; break; 1 } 1 void Meeting: :drop_media(int participant, MediaBrldgeDesc med ) List_of _pitβr (Conferee ) clist < conf _list ) ; Conferee *e; ~ * clist.rese (); while (clist.next(c)) { if (c->Id() — participant) ( c->drop_aβdia(aed) ; break; " 1 } ) void Meeting: :drop media(MediaBrldgeDesc sod) { List_of_pitβr(Conferee) clist(conf_list) ; Conferee *e; " clist.reset() ; while (clist.next(c)) { c->drop aedia(aed) ; 1 } int Meeting::leave aeeting(int participant) { List_of_pitβr(Conferee) clist(conf_list) ; Conferee *c; clist.reset(); while (clist.next(c) ) ( if (c->Id() — participant) { c->lβavβ(); return(0) ; > ) return(-ERR_PARTICIPANT NOT_PRESENT) ; } int Meeting: :reenter jneeting (int participant) { List_of_pitβr (Conferee) clist (conf_list) ; Conferee *c; clist.reset() ; while (clist.next(c) ) ( if (c->Id() — participant) { c->xeenter() ; return(0) ; 1 } return(-ERR PARTΣCIPANT_NOT_PRESENT) ; // Conferee methods void Conferee::add_mβdia(MediaBridgeDescs med) { media_list.add(med) ; } void Conferee: :dropjnedia(MediaBridgeDescs med) { media_list.remove(med.m) ; ) // RoomFsmMgr methods int RoomFsmMgr::CreatβNβwFSM(int vi_rooa_id, int actual rooa_id, InterObjectBufferS iob)- { RooaFsa *r; rooa_list.reset(); while (rooa_list.next(r)) { if Tr->V RooaΣd() — vi_rooa_id I I r->RβalRoomId() — actual_room_id) { eout « "Room already existingT Just firing..." « endl; return(-ERR_ROOM ALREADY PRESENT); 1 . if ((r - new RooaFsa(vi rooa id, actual rooa id, iob, this)) — NULL) retur (-ERR NO RESOURCES?; " ~ rooa_lis .insertjiext(r); return(SUCCESS) ; ) int RoomFsmMgr::fire VI(int vi_room_id, InterObjectBufferS iob) { RoomFsm *r; room_list.reset ; while (room_list.next(r)) { if (r->V RoomId() — vi_room_id) ( ♦ifdβf DEBUG "* ~ cout « "FirβVI > VlRooald: " « vi_rooa_id « endl; ♦endif " r->fire(iob) ; garbagβ_colleet(r) ; return(SUCCESS) ; . ) return(SUCCESS) ; ) int R oomFsπ-Mgr: :fire(int actual_room_id, InterObjectBufferS iob ) I RoomFsm *r; room_list.reset() ; while (rooα_list.next(r)) { if (r->RβalRooaId() — actual_room_id) { ♦ifdef DEBUG cout « "Fire > RβalRoomld: " « actual_room_ιd « endl;. ♦endif r->fire(iob); garbage_collect(r) ; return(SUCCESS) ; 1 } return(SUCCESS) ; ) int RoomFsn*4gr: :fire_using_seqno (int seqjio, InterObjectBufferS iob ) { RoomFsm *r; room list.reset( ) ; while (room_list.nex ( ) ) { if (r->LastSeqNo<) — seq_no) ( ♦ifdef DEBUG cout « "PirβSeq — — > Seq: " « seqjio « endl; ♦endif r->f ire (iob) ; garbage_eollect (r) ; return (SUCCESS) ; ) 1 return (SUCCESS) ; ) void RooaFsaMgr: : garbage collect (RooaFsa *r) i if (r->statβ () — STJTerainate) ( rooa_list . rβaovβ_prev ( ) ; delete r; ) ) void RooaFsaMgr: : garbage collect 0 { RooaFsa *r; room_list.reset(); while (rooa_list.next(r)) { if (r->statβ() — STJTerminate) { room_list.remove_prev() ; delete r; > } ) void RoomFsmMgr::alarm_handlβr() ( RooaFsa *r; List of_piter(RooaFsa) rlist(rooa_list) ; rlist.reset ; while (rlist.next(r) ) { if (r) { r->tiaβr_tick() ; ) )

Claims: -307 - CLAIMS 1. A multimedia communications network, comprising: a plurality of multimedia ports, each for connecting the network to a user terminal; at least one meeting room server connected to the ports for creating an electronic circuit configuration in the network representing a controllably persistent virtual meeting room in response to commands from any one of the user terminals; and means responsive to the meeting room server for effectuating connections in one or more selected media between selected ones of the plurality of ports. 2. The multimedia network of claim 1, in which the means for effectuating connections comprises: a plurality of electronic resources for effectuating conferences in a first medium between two or more users. 3. The multimedia network of claim 2, in which the means for effectuating connections comprises: a plurality of electronic resources for effectuating conferences in a second medium between two or more users. 4. The multimedia network of claim 3, in which the means for effectuating connections comprises: a plurality of electronic resources for effectuating conferences in a third medium between two or more users. 5. The multimedia network of claim 4, in which the first medium is audio. 6. The multimedia network of claim 4, in which the second medium is video. 7. The multimedia network of claim 4, in which the third medium is data. 8. The multimedia network of claim 4, in which the plurality of electronic resources for effectuating - 308 - conferences in a first medium comprises a plurality of audio servers. 9. The multimedia network of claim 4, in which the plurality of electronic resources for effectuating conferences in a second medium comprises a plurality of video servers. 10. The multimedia network of claim 4, in which the plurality of electronic resources for effectuating conferences in a third medium comprises a plurality of data servers. 11. The multimedia network of claim 10, in which the data servers comprise windows bridges. 12. The multimedia network of claim 4, further comprising: a means for associating selected ones of the electronic resources with the circuit configuration representing a virtual meeting room produced by the meeting room server. 13. The multimedia network of claim 12, further comprising: a means for creating an electronic circuit conference configuration representing an association between selected users and the virtual meeting room. 14. The multimedia network of claim 13, further comprising: a name server containing electronic circuit configurations representing a plurality of potential users of the multimedia network, the means for creating associations between selected users and virtual meeting rooms being responsive to the name server. 15. The multimedia network of claim 1, in which each of the plurality of multimedia comprises: a conversation manager input responsive to commands from a conversation manager in a respective user terminal; a data manager input responsive to a data manager in a respective user terminal; _ 309 _ a video manager input responsive to a video manager in a respective user terminal; and a voice manager input responsive to a voice manager in a respective user terminal. 16. The multimedia network of claim 1, in which the meeting room server comprises: an input/output port for communicating with additional meeting room servers in the multimedia network. 17. A user terminal for connection to a multimedia communications network, comprising: a user interface; a conversation manager connected to the user interface for connection with a meeting room server in the communications network; a data manager for connecting the conversation manager with a data server in the network; a video manager for connecting the conversation manager with a video server in the network; and a voice manager for connecting the conversation manager with an audio server in the network.

Inventors: AHUJA SUDHIR RAMAN, ARAVAMUDAN MURALI, ENSOR JAMES ROBERT, AHUJA, SUDHIR, RAMAN, ARAVAMUDAN, MURALI, ENSOR, JAMES, ROBERT
Applicants: AT & T CORP, AT & T CORP.
Application year: 1994
Main classification: H04N1
IPC codes: G06F13, G06F15, H04L12, H04M3, H04M9, H04M11, H04N7