def writeConferenceCreateRequest(self, stream: BytesIO, pdu: GCCConferenceCreateRequestPDU): """ Write a GCCConferenceCreateRequestPDU to a stream. :param stream: byte stream to put the ConferenceCreateRequest data in. :param pdu: the PDU to write. """ stream.write(per.writeSelection(8)) stream.write(per.writeNumericString(pdu.conferenceName, 1)) stream.write(per.writeEnumeration(0)) stream.write(per.writeNumberOfSet(1)) stream.write(per.writeChoice(0xc0)) stream.write(per.writeOctetStream(GCCParser.H221_CLIENT_KEY, 4)) stream.write(per.writeOctetStream(pdu.payload))
def writeConferenceCreateRequest(self, stream, pdu): """ Read a GCCConferenceCreateRequestPDU and put its raw data into stream :param stream: byte stream to put the ConferenceCreateRequest data in :type stream: BytesIO :type pdu: GCCConferenceCreateRequestPDU """ stream.write(per.writeSelection(8)) stream.write(per.writeNumericString(pdu.conferenceName, 1)) stream.write(per.writeEnumeration(0)) stream.write(per.writeNumberOfSet(1)) stream.write(per.writeChoice(0xc0)) stream.write(per.writeOctetStream(GCCParser.H221_CLIENT_KEY, 4)) stream.write(per.writeOctetStream(pdu.payload))
def writeConferenceCreateResponse(self, stream: BytesIO, pdu: GCCConferenceCreateResponsePDU): """ Write a GCCConferenceCreateResponsePDU to a stream. :param stream: byte stream to put the ConferenceCreateResponse data in. :param pdu: the PDU to write. """ stream.write(Uint16BE.pack(GCCParser.NODE_ID - 1001)) stream.write(per.writeInteger(1)) stream.write(per.writeEnumeration(0)) stream.write(per.writeNumberOfSet(1)) stream.write(per.writeChoice(0xc0)) stream.write(per.writeOctetStream(GCCParser.H221_SERVER_KEY, 4)) stream.write(per.writeOctetStream(pdu.payload))
def writeConferenceCreateResponse(self, stream, pdu): """ Read a GCCConferenceCreateResponsePDU and put its raw data into stream :param stream: byte stream to put the ConferenceCreateResponse data in :type stream: BytesIO :type pdu: GCCConferenceCreateResponsePDU """ stream.write(Uint16BE.pack(GCCParser.NODE_ID - 1001)) stream.write(per.writeInteger(1)) stream.write(per.writeEnumeration(0)) stream.write(per.writeNumberOfSet(1)) stream.write(per.writeChoice(0xc0)) stream.write(per.writeOctetStream(GCCParser.H221_SERVER_KEY, 4)) stream.write(per.writeOctetStream(pdu.payload))
def writeDataPDU(self, stream: BytesIO, pdu: Union[MCSSendDataRequestPDU, MCSSendDataIndicationPDU]): """ Encode a Data PDU :param stream: The destination stream to write into. :param pdu: the PDU to encode. """ stream.write(Uint16BE.pack(pdu.initiator - MCSChannelID.USERCHANNEL_BASE)) stream.write(Uint16BE.pack(pdu.channelID)) stream.write(per.writeEnumeration(pdu.priority)) stream.write(per.writeOctetStream(pdu.payload))