if event is None or event.event != self.event.decode() or (body is not None and content_type is not None and content_type.content_type.encode() not in ua.events[event.event.encode()]):
- raise SIPCoreInvalidStateError('Can only accept an incoming SUBSCRIBE in the "incoming" or "pending" state, object is currently in the "%s" state' % self.state)
+ if self.state not in ("INCOMING", "PENDING"):
+ raise SIPCoreInvalidStateError('Can only accept an incoming SUBSCRIBE in the "INCOMING" or "PENDING" state, object is currently in the "%s" state' % self.state)
if (content_type is None and content is not None) or (content_type is not None and content is None):
raise ValueError('Either both or neither of the "content_type" and "content" arguments should be specified')