Checking if inbound or outbound message