def recvConnectInitial(self, data): """ @summary: Receive MCS connect initial from client Send Connect Response Wait Erect Domain Request @param data: {Stream} """ ber.readApplicationTag(data, UInt8(Message.MCS_TYPE_CONNECT_INITIAL)) ber.readOctetString(data) ber.readOctetString(data) if not ber.readBoolean(data): raise InvalidExpectedDataException("invalid expected BER boolean tag") self.readDomainParams(data) self.readDomainParams(data) self.readDomainParams(data) self._clientSettings = gcc.readConferenceCreateRequest(Stream(ber.readOctetString(data))) if not self._clientSettings.CS_NET is None: i = 1 for channelDef in self._clientSettings.CS_NET.channelDefArray._array: self._serverSettings.SC_NET.channelIdArray._array.append(UInt16Le(i + Channel.MCS_GLOBAL_CHANNEL)) #if channel can be handle by serve add it for serverChannelDef, layer in self._virtualChannels: if channelDef.name == serverChannelDef.name: self._channels[i + Channel.MCS_GLOBAL_CHANNEL] = layer i += 1 self.sendConnectResponse() self.setNextState(self.recvErectDomainRequest)
def recvConnectInitial(self, data): """ @summary: Receive MCS connect initial from client Send Connect Response Wait Erect Domain Request @param data: {Stream} """ ber.readApplicationTag(data, UInt8(Message.MCS_TYPE_CONNECT_INITIAL)) ber.readOctetString(data) ber.readOctetString(data) if not ber.readBoolean(data): raise InvalidExpectedDataException( "invalid expected BER boolean tag") self.readDomainParams(data) self.readDomainParams(data) self.readDomainParams(data) self._clientSettings = gcc.readConferenceCreateRequest( Stream(ber.readOctetString(data))) if not self._clientSettings.CS_NET is None: i = 1 for channelDef in self._clientSettings.CS_NET.channelDefArray._array: self._serverSettings.SC_NET.channelIdArray._array.append( UInt16Le(i + Channel.MCS_GLOBAL_CHANNEL)) #if channel can be handle by serve add it for serverChannelDef, layer in self._virtualChannels: if channelDef.name == serverChannelDef.name: self._channels[i + Channel.MCS_GLOBAL_CHANNEL] = layer i += 1 self.sendConnectResponse() self.setNextState(self.recvErectDomainRequest)
def recvConnectResponse(self, data): """ @summary: Receive MCS connect response from server Send Erect domain Request Send Attach User Request Wait Attach User Confirm @param data: {Stream} """ ber.readApplicationTag(data, UInt8(Message.MCS_TYPE_CONNECT_RESPONSE)) ber.readEnumerated(data) ber.readInteger(data) self.readDomainParams(data) if not ber.readUniversalTag(data, ber.Tag.BER_TAG_OCTET_STRING, False): raise InvalidExpectedDataException("invalid expected BER tag") gccRequestLength = ber.readLength(data) if data.dataLen() != gccRequestLength: raise InvalidSize("bad size of GCC request") self._serverSettings = gcc.readConferenceCreateResponse(data) #send domain request self.sendErectDomainRequest() #send attach user request self.sendAttachUserRequest() #now wait user confirm from server self.setNextState(self.recvAttachUserConfirm)