def __init__(self): ''' Constructor ''' SCCPMessage.__init__(self, SCCPMessageType.RegisterAvailableLinesMessage) self.nboflines = 1
def __init__(self, event, line=0, callId=0): ''' Constructor ''' SCCPMessage.__init__(self, SCCPMessageType.SoftKeyEventMessage) self.event = event self.line = line self.callId = callId
def __init__(self,event,line=0,callId=0): ''' Constructor ''' SCCPMessage.__init__(self, SCCPMessageType.SoftKeyEventMessage) self.event=event self.line=line self.callId=callId
def __init__(self): ''' Constructor ''' SCCPMessage.__init__(self, SCCPMessageType.CapabilitiesResMessage) self.capCount=3 self.payLoads="\x19\x00\x00\x00\x78\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" self.payLoads=self.payLoads+"\x04\x00\x00\x00\x28\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" self.payLoads=self.payLoads+"\x02\x00\x00\x00\x28\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
def __init__(self): SCCPMessage.__init__(self, SCCPMessageType.DefineTimeDate) self.year=0 self.month=0 self.dayOfWeek=0 self.day=0 self.hour=99 self.minute=99 self.seconds=99 self.milliseconds=99 self.timestamp=0
def __init__(self, deviceName, ipAddress): ''' Constructor ''' SCCPMessage.__init__(self, SCCPMessageType.RegisterMessage) self.deviceName = deviceName self.ipAddress = IpAddress(ipAddress) self.stationUserId = self.STATION_USERID self.stationInstance = self.STATION_INSTANCE self.deviceType = self.TelecasterBus self.maxStreams = self.MAXSTREAMS
def __init__(self, deviceName, ipAddress): """ Constructor """ SCCPMessage.__init__(self, SCCPMessageType.RegisterMessage) self.deviceName = deviceName self.ipAddress = IpAddress(ipAddress) self.stationUserId = self.STATION_USERID self.stationInstance = self.STATION_INSTANCE self.deviceType = self.TelecasterBus self.maxStreams = self.MAXSTREAMS
def __init__(self): SCCPMessage.__init__(self, SCCPMessageType.DefineTimeDate) self.year = 0 self.month = 0 self.dayOfWeek = 0 self.day = 0 self.hour = 99 self.minute = 99 self.seconds = 99 self.milliseconds = 99 self.timestamp = 0
def pack(self): strPack = SCCPMessage.pack(self) strPack = strPack + pack("I",self.channelStatus) strPack = strPack + self.ipAddress.pack() strPack = strPack + pack("I",self.portNumber) strPack = strPack + pack("I",self.passThruPartyId) return strPack
def testOnKeepAliveTimer(self): networkClient = Mock() self.sccpPhone.client = networkClient keepaliveMessage = SCCPMessage(SCCPMessageType.KeepAliveMessage) self.sccpPhone.onKeepAliveTimer() networkClient.sendSccpMessage.assert_called_with(keepaliveMessage)
def pack(self): strPack = SCCPMessage.pack(self) + self.deviceName + "\x00" strPack = strPack + pack("II", self.stationUserId, self.stationInstance) strPack = strPack + self.ipAddress.pack() strPack = strPack + pack("III", self.deviceType, self.maxStreams, 0) strPack = strPack + "\x0B" + "\x00" + "\x60" + "\x85" strPack = strPack + pack("IIII", 0, 0, 0, 0) return strPack
def __eq__(self,other): if (self.event != other.event): return False if (self.line != other.line): return False if (self.callId != other.callId): return False return SCCPMessage.__eq__(self, other)
def __eq__(self, other): if (self.event != other.event): return False if (self.line != other.line): return False if (self.callId != other.callId): return False return SCCPMessage.__eq__(self, other)
def pack(self): strPack = SCCPMessage.pack(self) + self.deviceName + "\x00" strPack = strPack + pack("II", self.stationUserId, self.stationInstance) strPack = strPack + self.ipAddress.pack() strPack = strPack + pack("III", self.deviceType, self.maxStreams, 0) strPack = strPack + '\x0B' + '\x00' + '\x60' + '\x85' strPack = strPack + pack('IIII', 0, 0, 0, 0) return strPack
def testHandleUnknownMessage(self): message = SCCPMessage(0xFFFF) self.clientFactory.handleUnknownMessage(self.handleUnknown) self.clientFactory.handleMessage(message) self.assertTrue(self.unkown) self.assertEquals(0xFFFF, self.lastMessageTypeReceived)
def __init__(self,line): SCCPMessage.__init__(self, SCCPMessageType.LineStatReqMessage) self.line = line
def pack(self): strPack = SCCPMessage.pack(self) strPack = strPack + pack("L",self.capCount) strPack = strPack + self.payLoads return strPack
def __init__(self): SCCPMessage.__init__(self, SCCPMessageType.LineStatMessage) self.line=0 self.dirNumber = ""
def __init__(self): SCCPMessage.__init__(self, SCCPMessageType.SelectSoftKeysMessage)
def __init__(self): SCCPMessage.__init__(self, SCCPMessageType.StartToneMessage)
def __init__(self, channelStatus, ipAddress, portNumber, passThruPartyId): SCCPMessage.__init__(self, SCCPMessageType.OpenReceiveChannelAck) self.channelStatus = channelStatus self.ipAddress = IpAddress(ipAddress) self.portNumber = portNumber self.passThruPartyId = passThruPartyId
def __init__(self): SCCPMessage.__init__(self, SCCPMessageType.ActivateCallPlaneMessage)
def __init__(self): SCCPMessage.__init__(self, SCCPMessageType.OpenReceiveChannel) self.echoCancelType = 0 self.bitRate = 0
def __init__(self): SCCPMessage.__init__(self, SCCPMessageType.DisplayPromptStatusMessage)
def __init__(self): SCCPMessage.__init__(self, SCCPMessageType.TimeDateReqMessage)
def testSendSccpMessage(self): message = SCCPMessage(SCCPMessageType.ButtonTemplateReqMessage) networkClient = Mock() self.clientFactory.client=networkClient self.clientFactory.sendSccpMessage(message) networkClient.sendString.assert_called_with(message.pack())
def __init__(self): SCCPMessage.__init__(self, SCCPMessageType.ButtonTemplateReqMessage)
def __eq__(self,other): return SCCPMessage.__eq__(self, other) and self.button == other.button
def __init__(self): SCCPMessage.__init__(self, SCCPMessageType.KeepAliveAckMessage)
def __init__(self): SCCPMessage.__init__(self, SCCPMessageType.CallStateMessage) self.line = 0 self.callState = self.SCCP_CHANNELSTATE_DOWN self.callId = 0
def __init__(self): ''' Constructor ''' SCCPMessage.__init__(self, SCCPMessageType.RegisterAvailableLinesMessage) self.nboflines=1
def pack(self): strPack = SCCPMessage.pack(self) strPack = strPack + pack("I", self.event) strPack = strPack + pack("I", self.line) strPack = strPack + pack("I", self.callId) return strPack
def __init__(self): SCCPMessage.__init__(self, SCCPMessageType.LineStatMessage) self.line = 0 self.dirNumber = ""
def pack(self): strPack = SCCPMessage.pack(self) strPack = strPack + pack("I",self.event) strPack = strPack + pack("I",self.line) strPack = strPack + pack("I",self.callId) return strPack
def onKeepAliveTimer(self): self.log('on keep alive') message = SCCPMessage(SCCPMessageType.KeepAliveMessage) self.client.sendSccpMessage(message)
def __init__(self): SCCPMessage.__init__(self, SCCPMessageType.RegisterAckMessage) self.keepAliveInterval = 50 self.dateTemplate = "" self.secondaryKeepAliveInterval=32
def pack(self): strPack = SCCPMessage.pack(self) strPack = strPack + pack("L", self.button) return strPack
def pack(self): strPack = SCCPMessage.pack(self) strPack = strPack + pack("L",self.line) return strPack
def __init__(self): SCCPMessage.__init__(self, SCCPMessageType.RegisterAckMessage) self.keepAliveInterval = 50 self.dateTemplate = "" self.secondaryKeepAliveInterval = 32
def testSendSccpMessage(self): message = SCCPMessage(SCCPMessageType.ButtonTemplateReqMessage) networkClient = Mock() self.clientFactory.client = networkClient self.clientFactory.sendSccpMessage(message) networkClient.sendString.assert_called_with(message.pack())
def __init__(self,button): SCCPMessage.__init__(self, SCCPMessageType.KeypadButtonMessage) self.button = button
def __init__(self): SCCPMessage.__init__(self, SCCPMessageType.CapabilitiesReqMessage)
def pack(self): strPack = SCCPMessage.pack(self) strPack = strPack + pack("L",self.button) return strPack
def __init__(self, button): SCCPMessage.__init__(self, SCCPMessageType.KeypadButtonMessage) self.button = button
def __init__(self): SCCPMessage.__init__(self, SCCPMessageType.SetSpeakerModeMessage) self.mode = 0
def testPack(self): message = SCCPMessage(SCCPMessageType.RegisterMessage) self.assertEquals("\x00\x00\x00\x00\x01\x00\x00\x00",message.pack()) pass
def __eq__(self, other): return SCCPMessage.__eq__(self, other) and self.button == other.button